Solve Blocks > Example: Solving Nonlinear Systems of Equations
Example: Solving Nonlinear Systems of Equations
Use solve blocks to solve a system of n equations in n unknowns.
1. Insert a solve block and define the guess values, the constraints and the solver function Find.
2. Evaluate vec:
Solving Equations in Matrix Form
You can solve matrix equations, using Eigenanalysis or a solve block.
1. Solve the following non-linear equation:
2. Use the eigenvecs function to calculate the eigenvectors of matrix M:
3. Use the eigenvals to calculate the eigenvalues of matrix M, and the diag function to place these values along the diagonal of matrix Vals:
4. Use the Vectorization and Transpose operators to find X:
5. Use the solver function Find in a Solve Block to find X:
6. Evaluate Xsb2 or M:
Solving for Quantities with Units
You can use solve blocks to solve for quantities with units. This example determines the velocity of flow through a straight length of pipe.
1. Define the density and permeability of the flowing substance:
2. Define the diameter and length of the pipe:
3. Define the pressure and gravitational force within the pipe:
4. Find the solution for v, f, and NRe