Solving Systems of Equations |
Find(var1, var2, ...) Returns the values of var1, var2... that satisfy the equations and inequalities in a Solve Block. If you are solving for n variables, the solve block must have n equations. Matrix notation is allowed, as is solving for matrix variables. The Find function chooses an appropriate method from a group of available methods, depending on whether the problem is linear or nonlinear, and other attributes.
The universal notes on constructing Solve Blocks apply. Within the body of the block:
Equations: Equations must be defined using Boolean equals. No definitions are allowed within the body of a Solve Block.
Constraints: Inequality constraints, using Boolean operators, are allowed.
Output of the Find function may be assigned to a single variable, a vector of explicit variable names, or a function of other variable names within the solve block (including guess variables), parameterizing the solve block. See the QuickSheet example. If the variables have different units, they may only be assigned to an explicit vector of names, to avoid mixed units in matrices.
When there is one unknown scalar variable, the solution is a scalar. Otherwise, the solution is a vector whose first element is var1, second element is var2, and so on. You cannot solve for a single element of a vector used in the block. All vector values are adjusted simultaneously to minimize the error.
Find may also be evaluated symbolically, giving a solution to the system of equations in terms of the variable names, if possible. Inequality constraints are not allowed in this case.
TOL and CTOL can affect the solution to nonlinear systems. Setting these values too small may cause the solver not to converge. If adjusting these parameters does not help, try different guess values, or add an inequality constraint.
If your system does not converge, and you would like to know the solution that was found, even though it did not meet the convergence criteria, use Minerr.