0
$\begingroup$

I am trying to plot a phase plane portrait of the following system:

dQ/dt = v*(z - Q)*(w^2 + Q^2)/(1 + Q^2) - Q

dz/dt = k - Q

where v = 1, k = 0.2, and w = 0.05.

So far, I have the following:

v = 1;k = 0.2;w = 0.05
QNullcline = Solve[{0 == v*(z - Q)*(w^2 + Q^2)/(1 + Q^2) - Q}, Q];
zNullcline = Solve[0 == k - Q, Q];



P1 = Plot[QNullcline[[1]][[1]][[2]], {z, 0, 10}, PlotStyle -> Blue];

P2 = Plot[QNullcline[[2]][[1]][[2]], {z, 0, 10}, PlotStyle -> Purple];

P3 = Plot[QNullcline[[3]][[1]][[2]], {z, 0, 10}, PlotStyle -> Green];

P4 = Plot[QNullcline[[1]][[1]][[2]], {z, 0, 10}, PlotStyle -> Red];

P5 = StreamPlot[{v*(z - Q)*(w^2 + Q^2)/(1 + Q^2) - Q, 
   k - Q}, {Q, 0, 10}, {z, 0, 10}];

Show[P1,P2,P3,P4,P5]

I have two questions:

1.) Did I plot the null clines properly or are they supposed to better match the stream plot?

2.) Is there a way to show that the model is oscillatory in the phase plane diagram?

Any help would be greatly appreciated!

Thank you!

$\endgroup$

1 Answer 1

3
$\begingroup$

update

answer #1:

(* examplary solution to verify streamplot*)
z0 = 10; Q0 = 8;
T = 50;
zQ = NDSolveValue[{Q'[t] == 
v*(z[t] - Q[t])*(w^2 + Q[t]^2)/(1 + Q[t]^2) - Q[t], 
z'[t] == k - Q[t], Q[0] == Q0, z[0] == z0}, {z, Q }, {t, 0, 50}]

Perhaps it's easier using ContourPlot to show the nullclines.

Try

Show[{StreamPlot[{k - Q, v*(z - Q)*(w^2 + Q^2)/(1 + Q^2) - Q}, {z, 0, 
    10}, {Q, -2, 5}, FrameLabel -> {z, Q }]
  , ParametricPlot[Through[zQ[t]], {t, 0, T}, 
   PlotRange -> {{0, 10}, {0, 10}}, PlotStyle -> Red]
   , ContourPlot[{0 == v*(z - Q)*(w^2 + Q^2)/(1 + Q^2) - Q, 
    0 == k - Q}, {z, 0, 10}, {Q, -2, 5}]}]

enter image description here

answer #2:

Phase plane should show closed curves around stable equilibrium points if the model is oscillatory.

$\endgroup$
4
  • $\begingroup$ The two variables of the model are k and z. Why is k on the y-axis? (Also thank you! This was super helpful.) $\endgroup$
    – tardigrade
    Oct 25, 2021 at 6:28
  • $\begingroup$ @tardigrade Sorry, I corrected my answer, hopefully it's now ok. $\endgroup$ Oct 25, 2021 at 6:49
  • $\begingroup$ I think the code for zQ is cut off. What did you put at the end of the NDSolveValue function? Thank you $\endgroup$
    – tardigrade
    Oct 25, 2021 at 6:55
  • $\begingroup$ I completed zQ $\endgroup$ Oct 25, 2021 at 7:17

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.