All solutions of system of nonlinear equations
17 views (last 30 days)
Show older comments
I want to solve this system of two nonlinear equations:
A=x1^2-x2+1;
B=x1-cos(pi/2*x2);
By plotting these equations, there are three intersections between them and so there are three solutions. But the 'solve' function, only gives the one of the solutions. How can I see all three solutions simultaneously without using any constraint on variables like initial guess for numerical solutions or defining intervals for variables.
0 Comments
Accepted Answer
Walter Roberson
on 30 Jul 2015
Not correct. For all x2 from 0.9025214010 and larger, there are two real-valued x1 which satisfy the condition. There are an infinite number of real-valued solutions, not only 3 solutions.
For some real-valued x1, there are 3 real-valued x2 that are solutions, such as x1 = -10 for which there are solutions at x2 = 110, 111, 112. For some real-valued x1, there are 2 real-valued x2 that are solutions. For some real-valued x1, there is only a single real-valued solution.
For any given x1, the solution set for x2 is
2/pi * RootOf(-pi * x1^2 - pi*cos(Z) + pi * x1 - pi + 2*Z, Z)
where RootOf(f(z),z) stands for the set of values, z, such that f(z) = 0 -- the roots of the values. RootOf() is a routine in the Symbolic Toolbox.
If you want to go further in automatically finding multiple roots, feval(symengine) in conjunction with the information at http://www.mathworks.com/help/symbolic/mupad_ug/solve-equations-numerically.html
0 Comments
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!