phaseportpoisson2.mws

phaseportpoisson2.mws

Plot phase portrait for moment closure equations for Verhulst logistic model, assuming Poisson distribution.

This Maple work sheet uses Maple8,  and the new package LinearAlgebra.  Date 030402.

>    restart;
with(DEtools,DEplot);
with(plots,display);
with(LinearAlgebra,Eigenvectors);
with(VectorCalculus,Jacobian);
XP:=Vector(2);

[DEplot]

[display]

[Eigenvectors]

[Jacobian]

XP := Vector(%id = 2763892)

In the original Verhulst model, take alpha1=alpha2=1, R0=4, N=100. Then a1=3/5, f1=5/3, f2=3/5. Take r/K=1 (by rescaling time). Put kappa1=X[1], kappa2=X[2].

The equations are given by the procedure G:

>    G:=proc(N,t,X,XP)
  XP[1]:=(60-X[1])*X[1]-X[2];
  XP[2]:=(100-0.6*X[1])*X[1]+119.4*X[2]-4*X[1]*X[2]-2*X[1];
end;

G := proc (N, t, X, XP) XP[1] := (60-X[1])*X[1]-X[2]; XP[2] := (100-.6*X[1])*X[1]+119.4*X[2]-4*X[1]*X[2]-2*X[1] end proc
G := proc (N, t, X, XP) XP[1] := (60-X[1])*X[1]-X[2]; XP[2] := (100-.6*X[1])*X[1]+119.4*X[2]-4*X[1]*X[2]-2*X[1] end proc
G := proc (N, t, X, XP) XP[1] := (60-X[1])*X[1]-X[2]; XP[2] := (100-.6*X[1])*X[1]+119.4*X[2]-4*X[1]*X[2]-2*X[1] end proc
G := proc (N, t, X, XP) XP[1] := (60-X[1])*X[1]-X[2]; XP[2] := (100-.6*X[1])*X[1]+119.4*X[2]-4*X[1]*X[2]-2*X[1] end proc

Run G to determine XP:

>    G(1,t,X,XP):

We determine the isoclines where the derivatives are equal to zero:

>    isocline1:=solve(XP[1],X[2]);
isocline2:=solve(XP[2],X[2]);

isocline1 := -(-60+X[1])*X[1]

isocline2 := -1.*X[1]*(-490.+3.*X[1])/(-597.+20.*X[1])

Plot the isoclines:

>    plot({isocline1,isocline2},X[1]=-10..100,y=-100..1000,discont=true);

[Maple Plot]

>    expand(subs(X[2]=isocline1,XP[2]));

7262.0*X[1]-360.0*X[1]^2+4*X[1]^3

>    plot(%,X[1]=-10..80);

[Maple Plot]

There are three critical points! Solve for them:

>    critp:=solve({XP[1],XP[2]},{X[1],X[2]});

critp := {X[1] = 0., X[2] = 0.}, {X[2] = 899.7234448, X[1] = 30.52588517}, {X[2] = 31.27655522, X[1] = 59.47411483}
critp := {X[1] = 0., X[2] = 0.}, {X[2] = 899.7234448, X[1] = 30.52588517}, {X[2] = 31.27655522, X[1] = 59.47411483}

I use P1, P2, P3 to denote the three critical points. They are numbered from the left.
CHECK the numbering here!

>    P1prel:=critp[1];
P2prel:=critp[2];
P3prel:=critp[3];

P1prel := {X[1] = 0., X[2] = 0.}

P2prel := {X[2] = 899.7234448, X[1] = 30.52588517}

P3prel := {X[2] = 31.27655522, X[1] = 59.47411483}

CHECK the ordering here!

>    P1:=[rhs(P1prel[1]),rhs(P1prel[2])];
P2:=[rhs(P2prel[2]),rhs(P2prel[1])];
P3:=[rhs(P3prel[2]),rhs(P3prel[1])];

P1 := [0., 0.]

P2 := [30.52588517, 899.7234448]

P3 := [59.47411483, 31.27655522]

Now determine the Jacobian of the right-hand sides of the given system of equations:

>    J:=Jacobian(XP,[X[1],X[2]]);

J := Matrix(%id = 1299360)

Determine the jacobian in each of the critical points:

>    J1:=subs(P1prel,J);

J1 := Matrix(%id = 1306728)

>    J2:=subs(P2prel,J);

J2 := Matrix(%id = 1309612)

>    J3:=subs(P3prel,J);

J3 := Matrix(%id = 1320172)

The eigenvalues and eigenvectors of these three matrices:

>    eg1:=Eigenvectors(J1,output=list);

>    eg2:=Eigenvectors(J2,output=list);

>    eg3:=Eigenvectors(J3,output=list);

eg1 := [[61.6983929032635672+0.*I, 1, Vector(%id = 1378992)], [117.701607096736438+0.*I, 1, Vector(%id = 1379032)]]
eg1 := [[61.6983929032635672+0.*I, 1, Vector(%id = 1378992)], [117.701607096736438+0.*I, 1, Vector(%id = 1379032)]]

eg2 := [[57.6051733243862216+0.*I, 1, Vector(%id = 1379392)], [-61.3604843643861884+0.*I, 1, Vector(%id = 1379432)]]
eg2 := [[57.6051733243862216+0.*I, 1, Vector(%id = 1379392)], [-61.3604843643861884+0.*I, 1, Vector(%id = 1379432)]]

eg3 := [[-57.3380638674352383+0.*I, 1, Vector(%id = 1379592)], [-120.106625132564744+0.*I, 1, Vector(%id = 1379632)]]
eg3 := [[-57.3380638674352383+0.*I, 1, Vector(%id = 1379592)], [-120.106625132564744+0.*I, 1, Vector(%id = 1379632)]]

Notice that P1 is an unstable node, P2 is a saddle point, P3 is a stable node. Furthermore,

CHECK the numbering here!

eg1[1] : slow manifold,     eg1[2]: fast manifold of unstable node P0. Both manifolds have negative slopes.

eg2[1]: unstable manifold, eg2[2]: stable manifold of saddle point P1.

eg3[1]: slow manifold,      eg3[2]: fast manifold of stable node P2.

A Maple procedure for determining initial values on each manifold near each critical point...

Think of it as transforming eg-to-init (eg2init):

>    eg2init:=proc(P,eg,d)
 local u,lu,v,k;
 u:=eg[3]; # This is an eigenvector.
 lu:=sqrt(u[1]^2+u[2]^2); # This is the length of the eigenvector u.
 v:=d*u/lu; # This is a vector of length d in the direction of u.
 [seq([x(0)=P[1]+(-1)^k*v[1],y(0)=P[2]+(-1)^k*v[2]],k=1..2)];
 #These are two initial values near P in the direction of the eigenvector.
end proc:

CHECK the numbering here!

>    init2unstable:=eg2init(P2,eg2[1],10);
init2stable:=eg2init(P2,eg2[2],10);
init3fast:=eg2init(P3,eg3[2],20);

init2unstable := [[x(0) = 30.35542714-0.*I, y(0) = 909.7219919-0.*I], [x(0) = 30.69634320+0.*I, y(0) = 889.7248977+0.*I]]
init2unstable := [[x(0) = 30.35542714-0.*I, y(0) = 909.7219919-0.*I], [x(0) = 30.69634320+0.*I, y(0) = 889.7248977+0.*I]]

init2stable := [[x(0) = 30.36009444-0.*I, y(0) = 889.7248192-0.*I], [x(0) = 30.69167590+0.*I, y(0) = 909.7220704+0.*I]]
init2stable := [[x(0) = 30.36009444-0.*I, y(0) = 889.7248192-0.*I], [x(0) = 30.69167590+0.*I, y(0) = 909.7220704+0.*I]]

init3fast := [[x(0) = 59.14713884-0.*I, y(0) = 11.27922823-0.*I], [x(0) = 59.80109082+0.*I, y(0) = 51.27388221+0.*I]]
init3fast := [[x(0) = 59.14713884-0.*I, y(0) = 11.27922823-0.*I], [x(0) = 59.80109082+0.*I, y(0) = 51.27388221+0.*I]]

Plot two orbits on the unstable manifold of P2:

>    plot2unstable:=DEplot(G,[x(t),y(t)],t=0..0.2,number=2,init2unstable,x=-10..100,y=-100..1000,arrows=none,stepsize=0.01,linecolor=red):
plot2unstable;

[Maple Plot]

Plot two orbits on the stable manifold of the saddle P2:

>    plot2stable:=DEplot(G,[x(t),y(t)],t=-0.2..0,number=2,init2stable,x=-10..100,y=-100..1000,arrows=none,stepsize=0.01,linecolor=red):
plot2stable;

[Maple Plot]

Plot two orbits on the fast manifold of P3:

>    plot3fast:=DEplot(G,[x(t),y(t)],t=-0.05..0,number=2,init3fast,x=-10..100,y=-100..1000,arrows=none,linecolor=red,stepsize=0.01):
plot3fast;

[Maple Plot]

Plot one orbit on the slow manifold of P3:

>    plot3slow:=DEplot(G,[x(t),y(t)],t=0..0.05,number=2,{[x(0)=500,y(0)=20]},x=-10..100,y=-100..1000,stepsize=0.001,arrows=none,linecolor=red):
plot3slow;

[Maple Plot]

NOTE:  The arrows on the final phase portrait become less pronounced if the commend "color=red" below is replaced by "color=yellow". Plot the direction field:  

>    plotarrows:=DEplot(G,[x(t),y(t)],t=0..0.1,number=2,{[x(0)=60,y(0)=31]},x=-10..100,y=-100..1000,stepsize=0.01,color=red,linecolor=red):
plotarrows;

[Maple Plot]

Plot three additional orbits:

>    init1:=[x(0)=10,y(0)=0]:
plot1:=DEplot(G,[x(t),y(t)],t=0..0.1,number=2,[init1],x=-10..100,y=-100..1000,stepsize=0.01,arrows=none,linecolor=red):
plot1;

[Maple Plot]

>    init2:=[x(0)=50,y(0)=1000]:
plot2:=DEplot(G,[x(t),y(t)],t=0..0.1,number=2,[init2],x=-10..100,y=-100..1000,stepsize=0.01,arrows=none,linecolor=red):
plot2;

[Maple Plot]

>    init3:=[x(0)=100,y(0)=1000]:
plot3:=DEplot(G,[x(t),y(t)],t=0..0.05,number=2,[init3],x=-10..100,y=-100..1000,stepsize=0.002,arrows=none,linecolor=red):
plot3;

[Maple Plot]

Final plot of all orbits:

>    display({plot2stable,plot2unstable,plot3fast,plot3slow,plotarrows,plot1,plot2,plot3},labels=[Mean,Variance],title=Poisson_Assumption);

[Maple Plot]

>