# Nullclines do not match vector field

I have the following system of differential equations.

\begin{align*} x'&=(p-e)y-kx\\ y'&=kx/h-y \end{align*}

I found that when $p-e>h$ I get a saddle.

Nullclines are

\begin{align*} y&=kx/(p-e)\\ y&=kx/h \end{align*}

Here is my Mathematica code to plot vector field and nullclines.

p=2;
e=1;
k=0.5;
h=0.5;
g1 = VectorPlot[{(p-e)*y-k*x, k*x/h-y}, {x, -10, 10}, {y, -10, 10}];
g2 = ContourPlot[{(p-e)*y-k*x==0, k*x/h-y==0}, {x, -10, 10}, {y, -10, 10}];
Show[g1, g2]


The vector field seems to be fine, I can see the saddle. However, nullclines do not "match" the vector field. What I expected is something like this: I would appreciate if anyone explains why nullclines are off with the vector field.

• The null clines are correct. You appear to be looking for the saddle paths, which is different. – Alan Feb 25 '18 at 17:44
• How to calculate them? – Alex Ivanov Feb 25 '18 at 18:29
• You should add an edit to your question to this ask this new question, so you can get an answer that matches your question. (Comments disappear eventually.) – Alan Feb 25 '18 at 19:08
• To expand on Alan's comment, the nullcline are when one variable isn't changing. You can see that on one nullcline, the arrows are all left or right (change only in x), and on the other, the arrow are all up and down (change only in y). – Chris K Feb 25 '18 at 19:51
• – Michael E2 Feb 25 '18 at 20:20

## 1 Answer

This plots the separatrices because the ODE system is linear. Normally, you want the initial conditions ics very close to the equilibrium cp. But the automatic method used for StreamPoints in VectorPlot and StreamPlot prunes streamlines that get close to one another. In general, one usually has to use NDSolve to construct the solutions.

cp = {0, 0};
jac = D[{(p - e)*y - k*x, k*x/h - y}, {{x, y}}];    (* Jacobian *)
ics =   (* initial velocity vectors of the separatrices at  cp  *)
Flatten[{cp + #, cp - #} & /@ Eigenvectors[jac /. {x -> 0, y -> 0}], 1];

VectorPlot[{(p - e)*y - k*x, k*x/h - y}, {x, -10, 10}, {y, -10, 10},
StreamPoints -> {Append[{#, Red} & /@ ics, None]}] Since the system is linear, possibly the OP wants actual line:

dirs = Eigenvectors[jac /. {x -> 0, y -> 0}];

VectorPlot[{(p - e)*y - k*x, k*x/h - y},
{x, -10.1, 10}, {y, -10.1, 10},
Epilog -> {Red, InfiniteLine[cp, #] & /@ dirs}, PlotRangePadding -> 0.1] 