Problem-Based Workflow for Solving Equations - MATLAB & Simulink (original) (raw)

Note

Optimization Toolbox™ provides two approaches for solving equations. This topic describes the problem-based approach. Solver-Based Optimization Problem Setup describes the solver-based approach.

To solve a system of equations, perform the following steps.

In addition to these basic steps, you can review the problem definition before solving the problem by using show orwrite. Set options for solve by using optimoptions, as explained in Change Default Solver or Options.

Warning

The problem-based approach does not support complex values in the following: an objective function, nonlinear equalities, and nonlinear inequalities. If a function calculation has a complex value, even as an intermediate value, the final result might be incorrect.

Note

All names in an optimization problem must be unique. Specifically, all variable names, objective function names, and constraint function names must be different.

For a basic equation-solving example with polynomials, see Solve Nonlinear System of Polynomials, Problem-Based. For a general nonlinear example, see Solve Nonlinear System of Equations, Problem-Based. For more extensive examples, see Systems of Nonlinear Equations.

See Also

fcn2optimexpr | optimvar | solve | optimoptions | eqnproblem | show | write

Topics