# Best way to calculate equilibria for a 2d system of ODEs

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.

• This might be of interest. – J. M.'s technical difficulties Aug 1 '17 at 2:31
• I'm not sure what I am looking for - a,thou – Stephen Aug 1 '17 at 3:01
• "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. – J. M.'s technical difficulties Aug 1 '17 at 3:17
• 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). – Stephen Aug 1 '17 at 3:18

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}}
*)