Solve Blocks > Example: Solve Blocks with Constraints
Example: Solve Blocks with Constraints
Use solve blocks in solving a system of equations with constraints.
Consider the intersection of a circle and a line. In the unconstrained case, the guess values determine which solution is found, when multiple solutions exist.
1. Insert a solve block, define the guess values and the constraints, then use the find solver function to find the intersection point between the line and the circle.
2. Plot the circle, the line and the intersection point.
The plot shows that this solution corresponds to one of the two intersection points, but the solver picked the point that is closest to the guess values.
3. Change the guess values and recalculate the solution.
4. Plot the circle, the line and the intersection point.
The plot shows that this solution corresponds to the second intersection point, because the solver picked the point that is closest to the new guess values.
5. Introduce an additional constraint of the form x > a, where a is constant. The region to the left of line a is now eliminated from consideration.
6. Plot the circle, the line and the intersection point. Use a vertical marker to show line a.
The plot shows that this solution corresponds to the first, and only possible, intersection point, because the solver has to satisfy the new constraint.