|
FindRoot
|
Batch language command
|
|
Find a root of an equation in a the interval [left_bound, right_bound]. Supports scalar expressions which HyPhy can differentiate. The equation solved is 'expression' = 0. Upon execution 'receptacle' is set to the root, or if no root could be found - to the value of left_bound.
|
Syntax
|
FindRoot (receptacle, expression, variable, left_bound, right_bound);
|
Notes
|
'receptacle' is the name of the variable to receive the root.
'expression' is the expression to define the equation with. It must be differentiable.
'variable' is the identifier of the variable with respect to which the equation should be solved.
'left_bound', r'ight_bound' define the interval where a root is located. 'right_bound' must be greater than 'left_bound'.
If no (or multiple) roots exist in the interval, 'receptacle' will be set to 'left_bound'.
|
Examples
|
FindRoot (root, x^3-2 ,x, 0, 2);
fprintf (stdout, "\nThe real cube root of 2 is:", root, "\n");
|
|
Last modified: 8/19/2002 |
|
|