Tfmin: Difference between revisions
From TomWiki
Jump to navigationJump to search
(Created page with "==Purpose== Minimize function of one variable. Find miniumum x in [x_L, x_U] for function Func within tolerance xTol. Solves using Brents minimization algorithm. Reference: "Co...") |
No edit summary |
||
Line 2: | Line 2: | ||
Minimize function of one variable. Find miniumum x in [x_L, x_U] for function Func within tolerance xTol. Solves using Brents minimization algorithm. Reference: "Computer Methods for Mathematical Computations", Forsythe, Malcolm, and Moler, Prentice-Hall, 1976. | Minimize function of one variable. Find miniumum x in [x_L, x_U] for function Func within tolerance xTol. Solves using Brents minimization algorithm. Reference: "Computer Methods for Mathematical Computations", Forsythe, Malcolm, and Moler, Prentice-Hall, 1976. | ||
==Calling Syntax== | ==Calling Syntax== |
Revision as of 08:03, 11 July 2011
Purpose
Minimize function of one variable. Find miniumum x in [x_L, x_U] for function Func within tolerance xTol. Solves using Brents minimization algorithm. Reference: "Computer Methods for Mathematical Computations", Forsythe, Malcolm, and Moler, Prentice-Hall, 1976.
Calling Syntax
[x, nFunc] = Tfmin(Func, x_L, x_U, xTol, Prob)
Description of Inputs
Variable | Description |
Func | Function of x to be minimized. Func must be defined as: |
f = Func(x) if no 5th argument Prob is given or | |
f = Func(x, Prob) if 5th argument Prob is given. | |
x_L | Lower bound on x. |
x_U | Upper bound on x. |
xTol | Tolerance on accuracy of minimum. |
Prob | Structure (or any Matlab variable) sent to Func. If many parameters are to be sent to Func set them in Prob as a structure. Example for parameters a and b: |
Prob.user.a = a; Prob.user.b = b; | |
[x, nFunc] = Tfmin('myFunc',0,1,1E-5,Prob); In myFunc: | |
function f = myFunc(x, Prob) | |
a = Prob.user.a; | |
b = Prob.user.b; | |
f = "matlab expression dependent of x, a and b"; |
Description of Outputs
Variable | Description |
x | Solution. |
nFunc | Number of calls to Func. |