I want to add equilibrium points to the or direction field of the autonomous system $dx/dt=f(x,y)$, $dy/dt=g(x,y)$. For simplicity I assume that f and g are smooth functions. How can I use NSolve to obtain just real valued solutions to $f(x,y)=0$, $g(x,y)=0$, where the solutions are constrained to lie in the window $[x_1,x_2]$ x $[y_1,y_2]$? Then I can plot them on my direction field. Reduce didn't do it for me. Also, I want to avoid the use of StreamPlot, even if it has a option to plot equilibria.
$\begingroup$
$\endgroup$
4
-
1$\begingroup$ This might be of interest. $\endgroup$– J. M.'s missing motivation ♦Commented Aug 1, 2017 at 2:31
-
$\begingroup$ I'm not sure what I am looking for - a,thou $\endgroup$– StephenCommented Aug 1, 2017 at 3:01
-
$\begingroup$ "obtain just real valued solutions to $f(x,y)=0$, $g(x,y)=0$, where the solutions are constrained to lie in the window $[x_1,x_2] \times [y_1,y_2]$" in your question can be handled by the routines in the thread I linked to. $\endgroup$– J. M.'s missing motivation ♦Commented Aug 1, 2017 at 3:17
-
$\begingroup$ I realize that I have not stated my question properly. What I need to know is how to calculate the number of equilibria without actually knowing their value(s). $\endgroup$– StephenCommented Aug 1, 2017 at 3:18
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
As posed, the question is too generic to be answered appropriately. In principle you should be able to use NSolve
and appropriate constraints, as long as all constants are given appropriate numerical values. Recall that NSolve
is a numerical solver, not a symbolic one.
Consider for instance:
With[
{x1 = -10, x2 = 10, y1 = -3, y2 = 5},
NSolve[{Sin[x y] == 0, x^2 + y == 0, x1 <= x <= x2, y1 <= y <= y2}, {x, y}, Reals]
]
(*Out:
{{x -> 0, y -> 0}, {x -> -1.46459, y -> -2.14503}, {x -> 1.46459, y -> -2.14503}}
*)