Rg of Sphere (GRID search)

The data above represent light scattering galvanometer measurements for a suspension of large latex spheres. Solvent intensity in this case is almost zero at any angle. Intensities are not corrected for scattering angle (i.e., volume); you have to apply the sin(q) correction yourself.

You probably already saw these data in a problem that asked you to use Excel Solver (or similar) to find the size. You essentially searched for I(0) and R values to fit the equation below to the data.

where x = qR (not Rg) and I(0) is the intensity at zero scattering angle.

A problem with Solver (and other nonlinear fitting algorithms) is that it can get “stuck” at a solution that is not really the best one, but just the best answer close to your initial starting guesses. For this reason, nonlinear fits should be performed from a variety of initial guesses. Even that does not guarantee you find the best answer.

These programs are searching for a minimum in the total error (e.g., Si(yfit – yi)2). They vary the parameters (in this case, I(0) and R) in a semi-intelligent way that quickly arrives at AN answer by a kind of guided trial and error process; however, the algorithm may not vary the parameters over a wide enough range to locate THE best solution.

In this problem, you attempt to fix that by brute force. You are to write a GRID SEARCH program that adjusts I(0) and R over a range that will certainly include the smallest and largest possible values. Your program will probably consist of nested loops that vary I(0) and R over any reasonable range, using a reasonable step size for each parameter. You will use these values to calculate I(q), compute the sum of squared errors over all the data points at different angles, and then continue searching. When you find the lowest sum of squared errors, that is your answer. You can compare it to the answer from Solver.