WOLFRAM SYSTEM MODELER
This information is part of the Modelica Standard Library maintained by the Modelica Association.
solveOneNonlinearEquation(function f(), u_min, u_max); solveOneNonlinearEquation(function f(), u_min, u_max, tolerance=100*Modelica.Constants.eps);
This function determines the solution of one non-linear algebraic equation "y=f(u)" in one unknown "u" in a reliable way. It is one of the best numerical algorithms for this purpose. As input, the nonlinear function f(u) has to be given, as well as an interval u_min, u_max that contains the solution, i.e., "f(u_min)" and "f(u_max)" must have a different sign. The function computes a smaller interval in which a sign change is present using the relative tolerance "tolerance" that can be given as 4th input argument.
The interval reduction is performed using inverse quadratic interpolation (interpolating with a quadratic polynomial through the last 3 points and computing the zero). If this fails, bisection is used, which always reduces the interval by a factor of 2. The inverse quadratic interpolation method has superlinear convergence. This is roughly the same convergence rate as a globally convergent Newton method, but without the need to compute derivatives of the non-linear function. The solver function is a direct mapping of the Algol 60 procedure "zero" to Modelica, from:
See the examples in Modelica.Math.Nonlinear.Examples.
Description: Function y = f(u); u is computed so that y=0
Description: Lower bound of search interval
Description: Upper bound of search interval
Default Value: 100 * Modelica.Constants.eps
Description: Relative tolerance of solution u
Description: Value of independent variable u so that f(u) = 0