1
$\begingroup$

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.

$\endgroup$
4
  • 1
    $\begingroup$ This might be of interest. $\endgroup$ Commented Aug 1, 2017 at 2:31
  • $\begingroup$ I'm not sure what I am looking for - a,thou $\endgroup$
    – Stephen
    Commented 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$ 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$
    – Stephen
    Commented Aug 1, 2017 at 3:18

1 Answer 1

1
$\begingroup$

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}}
*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.