MinimizeFunction:
PROC [
function: FunctionProc,
t0: REAL ¬ 0.0, -- minimum abscissa
t1: REAL ¬ 360.0, -- maximum abscissa
logSlope: REAL ¬ -1.758121, -- ~ RealFns.Log[10.0, 3.1416/180.0]
alpha: REAL ¬ 0.35,
slopeFac: REAL ¬ 0.5,
certainFac: REAL ¬ 1.0,
logEps: REAL ¬ -4.0,
lineProc: LineProc ¬ NIL,
report: STREAM ¬ NIL]
RETURNS [REAL];
Find the value of t within the interval [t0..t1] that minimizes function[t].
logslope is the log of the maximum slope of the function between t0 and t1;
this must be correct or the minimizing algorithm may fail.
If lineProc # NIL, then graph the tree of converging intervals.
If report # NIL, then make a status report to it at the end of the minimization.
See also: the chapter on minimization and unconstrained optimization in Numerical Recipes.
MinimizeMonotonic:
PROC [
function: FunctionProc,
t0: REAL ¬ 0.0, -- minimum abscissa
t1: REAL ¬ 360.0, -- maximum abscissa
eps: REAL] -- return if dt < eps
RETURNS [REAL];
Find the value of t within the interval [t0..t1] that minimizes function[t] presuming:
f has a single minimum within [t0..t1], and
f is monotonic on either side of the minimum.