MultivariateSolver
Finds real solutions to systems of equations using numerical methods. For certain systems involving sine and cosine, the equations show that exactly one real solution exists. The solver first tries a starting point derived from those equations. Otherwise, or if that attempt fails, it tries several starting points and collects the distinct solutions it finds.
A numerical search may miss solutions. An empty result does not prove there are none. Searching from a grid becomes more expensive as the number of variables increases, and starts that fail to converge are ignored. The solver is intended for systems with as many equations as variables. Calculations use the current decimal.js precision. The supplied equation and variable arrays are retained rather than copied.
Members
MultivariateSolver(equations: Expression[], variables: string[], options: MultivariateSolverOptions): MultivariateSolverConstructorSets up the equations, variable order, and numerical search settings.
Parameters
| Name | Type | Description |
|---|---|---|
equations | Expression[] | Expressions that should each equal zero. |
variables | string[] | Variable names in the order used by solution coordinates. |
options | MultivariateSolverOptions | Optional limits and tolerances for the numerical search. |
Returns
roots(): Map<string, Expression>[]MethodFinds distinct real solutions using either an inferred start or the grid.
Returns
Map<string, Expression>[] — One variable-to-value map per solution. An empty result means no
root was found, not that the system has no real roots.
