问题
I am trying to find intersection points of two curves
syms x y
g(x) = 20*(exp(-(x+30)/3.5)-1);
[sol_x, sol_y] = solve((x+22.3097)^2+(y+16.2497)^2 == 25, y == g(x),x,y,'Real',true) ;
It is giving only one solution. But according to the plot of the two equations, there should be two intersection points. How can I rectify this problem?
回答1:
The solver can not find a analytic solution, thus a numeric solver is used. There is no reliable way in finding all solutions with a numeric method, but if you have a good guess (e.g. from a plot) try vpasolve
with a reasonable set initial value. In this case, with a initial value of -50 I got another solution.
来源:https://stackoverflow.com/questions/24273413/matlab-solve-not-giving-all-the-solutions