I'm running an experiment -- for the question, it doesn't matter which one, but I'm measuring an optical intensity $I$ as a function of two parameters: reflection angle $\theta$ and wavelength $\lambda$. I have motion control in place to move the setup to an angle $\theta_0$, and then I measure $I(\theta_0, \lambda)$ all at once using a spectrometer. I then move to the next angle $\theta_1$ and repeat.

Due to the beam travelling through different media at different angles, I have to move the position of the detector $p$ slightly for each angle, which is also automated. I should move the detector so that $M(p) = \sum_\lambda I(\theta_n, \lambda, p)$ is maximized. (M stands for "figure of Merit".)

$M(p)$ approximately has the form of a Gaussian plus noise, but I should be able to maximize it without caring what form it has. I have an amateurish algorithm in place to search for the proper position $p$ in order to maximize $M(p)$.

The quick-n-dirty algorithm steps $p$ in one direction by a step size $\Delta p$, until the value of $M(p)$ becomes smaller than a previous value. Then it goes back one step and tries a smaller step size $\Delta p$ in the other direction. As you can see, it doesn't account for measurement noise. My thoughts on how to improve it were in the direction of measuring a small number of points spaced $\Delta p$ apart and then fitting a parabola through them.

My question is, before I sit down and design a better algorithm, can anyone suggest an already-existing algorithm? I don't think a feedback algorithm (such as PID control) is appropriate, since I'm not trying to maintain a certain setpoint under perturbation of the system -- I just need to optimize to one value for each measurement. For bonus points, can someone point me to some papers on this subject?

  • $\begingroup$ Perhaps you could explain your algorithm and what you don't like about it? $\endgroup$ Apr 5, 2012 at 13:48
  • 1
    $\begingroup$ Is there some reason you can't scan over some range and then go to the position where the signal was highest? $\endgroup$
    – Colin K
    Apr 5, 2012 at 19:29
  • $\begingroup$ Especially if it's gaussian; you could just measure 3 points and fit a parabola, if you want to be simple. $\endgroup$
    – Colin K
    Apr 5, 2012 at 19:32
  • $\begingroup$ I'm with Colin: the usual method is to estimate, scan and fit to get sub-interval resolution on finding the best value. Though if your scan covers more than the very round top of the peak I'd fit to the expected curve and not to a parabola. $\endgroup$ Apr 6, 2012 at 0:38
  • $\begingroup$ In my oppinion you could not maximaxe it without 'caring what form it has', if you only know the past measured values then your next position has to be sub-optimal. If you have it automated then put the system in 'learning mode': from the previous scans extract the information to adjust the next parameters to use in the fitting curve. $\endgroup$ Apr 6, 2012 at 1:10

1 Answer 1


Explore Runge Kutta, Finite Difference, Taylor Expansion, Maclaurin Series, Predictor/Corrector methods.
I found the Velocity Verlet integrator very interesting, and easily computed. You will have to find what is the approximate potential that drives the 'orbit', may be by experiment.

If you pretend to guess by sampling around then you may look the methods Binary_search_algorithm as an example of the general method Divide and Conquer.

If each answer belong to a parameterized family of equations then it could be interesting obtain first the general expression of the formula, and then use the first measures to calculate the actual parameters to be fed in the general expression.

For instance : make several scans using different deltas in the motion. Fed the results to the pakage formulize/eureqa to obtain a suitable general expression of the function. Suppose that formulize gives a nice approximation with 3 parameters , f.i. it obbeys a gaussian function. Then for each different experiment you can use a limited set of initial measures to extract the actual parameters that apply. Ideally for a 3 parameter function 3 measures will suffice, but because there exist noise do several sets of measures to improve the values you will use.
The formulize package has an API that can be explored to automate its use.

As an example: The sunspot cycles in general share a general similitude, i.e if well behaved one can describe the full cycle after the 3 initial years. (And folks believe that they make 'predictions', when it is only a postdiction, a data fit).

  • 1
    $\begingroup$ What is this? Throw buzzwords at the question and hope one sticks? Not one of the methods you suggest is well suited to the problem at hand. $\endgroup$ Apr 6, 2012 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.