3
$\begingroup$

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. enter image description here

What I expected is something like this: enter image description here

I would appreciate if anyone explains why nullclines are off with the vector field.

$\endgroup$
  • 3
    $\begingroup$ The null clines are correct. You appear to be looking for the saddle paths, which is different. $\endgroup$ – Alan Feb 25 '18 at 17:44
  • $\begingroup$ How to calculate them? $\endgroup$ – Alex Ivanov Feb 25 '18 at 18:29
  • 1
    $\begingroup$ 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.) $\endgroup$ – Alan Feb 25 '18 at 19:08
  • $\begingroup$ 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). $\endgroup$ – Chris K Feb 25 '18 at 19:51
  • 1
    $\begingroup$ Related: mathematica.stackexchange.com/q/135302 $\endgroup$ – Michael E2 Feb 25 '18 at 20:20
3
$\begingroup$

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]}]

Mathematica graphics

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]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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