Documentation

# Systems of Nonlinear Equations

Solve systems of nonlinear equations in serial or parallel

Find a solution to a multivariable nonlinear equation F(x) = 0. You can also solve a scalar equation or linear system of equations, or a system represented by F(x) = G(x) in the problem-based approach (equivalent to F(x) – G(x) = 0 in the solver-based approach). For nonlinear systems, solvers convert the equation-solving problem to the optimization problem of minimizing the sum of squares of the components of F, namely min(∑Fi2(x)). Linear and scalar equations have different solution algorithms; see Equation Solving Algorithms.

Before you begin to solve an optimization problem, you must choose the appropriate approach: problem-based or solver-based. For details, see First Choose Problem-Based or Solver-Based Approach.

For the problem-based approach, create problem variables, and then represent the equations in terms of these variables. For the problem-based steps to take, see Problem-Based Workflow for Solving Equations. To solve the resulting problem, use `solve`.

For the solver-based steps to take, including defining the objective function and choosing the appropriate solver, see Solver-Based Optimization Problem Setup.

## Functions

expand all

 `eqnproblem` Create equation problem `evaluate` Evaluate optimization expression `infeasibility` Constraint violation at a point `optimeq` Create empty optimization equality array `optimvar` Create optimization variables `show` Display optimization object `solve` Solve optimization problem or equation problem
 `fsolve` Solve system of nonlinear equations `fzero` Root of nonlinear function `lsqlin` Solve constrained linear least-squares problems `lsqnonlin` Solve nonlinear least-squares (nonlinear data-fitting) problems

## Objects

 `EquationProblem` System of nonlinear equations `OptimizationEquality` Equalities and equality constraints `OptimizationExpression` Arithmetic or functional expression in terms of optimization variables `OptimizationVariable` Variable for optimization

## Topics

### Problem-Based Systems of Nonlinear Equations

Solve Nonlinear System of Equations, Problem-Based

Solve a system of nonlinear equations using fcn2optimexpr.

Solve Nonlinear System of Polynomials, Problem-Based

Solve a polynomial system of equations using the problem-based approach.

Follow Equation Solution as a Parameter Changes

Solve a sequence of problems using the previous solution as a start point.

Nonlinear System of Equations with Constraints, Problem-Based

Solve a system of nonlinear equations with constraints using the problem-based approach.

### Solver-Based Systems of Nonlinear Equations

Nonlinear Equations with Analytic Jacobian

Use derivatives in nonlinear equation solving.

Nonlinear Equations with Finite-Difference Jacobian

Solve a nonlinear system of equations without derivative information.

Nonlinear Equations with Jacobian Sparsity Pattern

Solve a nonlinear system of equations with a known finite-difference sparsity pattern.

Nonlinear Systems with Constraints

Learn techniques for solving nonlinear systems of equations with constraints.

### Parallel Computing

What Is Parallel Computing in Optimization Toolbox?

Use multiple processors for optimization.

Using Parallel Computing in Optimization Toolbox

Perform gradient estimation in parallel.

Improving Performance with Parallel Computing

Investigate factors for speeding optimizations.

### Algorithms and Options

Equation Solving Algorithms

Solve linear systems of equations, nonlinear equations in one variable, and systems of n nonlinear equations in n variables.

Optimization Options Reference

Explore optimization options.

Watch now