general3.mws 030128
Determine the critical points of the first three moment closure equations for the Verhulst model, and their stabilities, under assumption that kappa4 = a4*N!
This Maple worksheet uses Maple 8, and the "new" package LinearAlgebra. 030226.
> | restart; |
> | with(VectorCalculus,Jacobian); with(LinearAlgebra,Eigenvalues); |
> | eq1:=(a1*N-kappa1)*kappa1-kappa2; |
> | eq2:=(f1*a1*N-f2*kappa1)*kappa1+(2*a1*N-f2)*kappa2-4*kappa1*kappa2-2*kappa3; |
> | eq3prel:=(a1*N-kappa1)*kappa1-6*f2*kappa1*kappa2-6*kappa1*kappa3+(3*f1*a1*N-1)*kappa2-6*kappa2^2+3*(a1*N-f2)*kappa3-3*kappa4; |
The assumption is that kappa4=a4*N:
> | eq3:=subs(kappa4=a4*N,eq3prel); |
Solve the first equation for kappa2. This gives kappa2 as a function of kappa1.
> | kap2:=solve(eq1,kappa2); |
Substitute this value of kappa2 into the second equation.
> | eq2a:=subs(kappa2=kap2,eq2); |
Solve this equation for kappa3. This gives kappa3 as a functiton of kappa1.
> | kap3:=solve(eq2a,kappa3); |
Insert the values of kappa2 and kappa3 into eq3. Divide by -3. This gives an expression in kappa1.
> | eq3a:=-map(simplify,collect(subs(kappa2=kap2,kappa3=kap3,eq3),kappa1))/3; |
The problem now is to solve this forth-degree equation in kappa1. (Some minor (cosmetic) simplification can be achieved by introducing K and sigma^2.) Assume there is an asymptotic approximation of the form
kappa1 = A*N + B + C/N:
> | eq3b:=subs(kappa1=A*N+B+C/N,eq3a); |
Determine the coefficients of N^4, N^3, N^2! Putting them equal to zero gives equations for A, B, C.
> | eqA:=coeff(eq3b,N,4); |
> | eqB:=coeff(eq3b,N,3); |
> | eqC:=coeff(eq3b,N,2); |
> | AA:=solve(eqA,A); |
> | evalf(%); |
Rearrange A-values in increasing order!
> | AA:=AA[1],AA[4],AA[3],AA[2]; |
There are four critical points. Determine the corresponding values of A and B!
> | BB:=seq(solve(subs(A=AA[k],eqB),B),k=1..4); |
> | CC:=seq(solve(subs(A=AA[k],B=BB[k],eqC),C),k=1..4); |
So now I have found approximations of the kappa1-coordinates of all 4 critical points.
Proceed to determine the kappa2- and kappa3-coordinates! Use kap2 and kap3...
> | kap21:=subs(kappa1=AA[1]*N+BB[1]+CC[1]/N,kap2); |
> | kap31:=subs(kappa1=AA[1]*N+BB[1]+CC[1]/N,kap3); |
Put DD[1]=EE[1]=FF[1]=0:
> | DD[1]:=0; EE[1]:=0; FF[1]:=0; |
> | kap2; |
> | kap22:=map(simplify,convert(asympt(subs(kappa1=AA[2]*N+BB[2]+CC[2]/N,kap2),N,0),polynom)); |
> | DD[2]:=coeff(kap22,N,2); |
> | EE[2]:=factor(simplify(coeff(kap22,N,1))); |
> | kap32:=map(simplify,convert(asympt(subs(kappa1=AA[2]*N+BB[2]+CC[2]/N,kap3),N,0),polynom)); |
> | FF[2]:=coeff(kap32,N,3); |
Now work on the third critical point:
> | kap23:=map(simplify,convert(asympt(subs(kappa1=AA[3]*N+BB[3]+CC[3]/N,kap2),N,0),polynom)); |
> | DD[3]:=coeff(kap23,N,2); |
> | EE[3]:=factor(coeff(kap23,N,1)); |
> | kap33:=map(simplify,convert(asympt(subs(kappa1=AA[3]*N+BB[3]+CC[3]/N,kap3),N,0),polynom)); |
> | FF[3]:=coeff(kap33,N,3); |
NOTE here that FF[3] is the coefficient of N^3! Proceed to the last critical point. This one has kappa1 sim K.
I expect different asymptotic orders for D,E,F.
> | kap24:=map(simplify,convert(asympt(subs(kappa1=AA[4]*N+BB[4]+CC[4]/N,kap2),N,1),polynom)); |
> | DD[4]:=coeff(kap24,N,1); |
> | EE[4]:=factor(coeff(kap24,N,0)); |
> | kap34:=expand(convert(asympt(subs(kappa1=AA[4]*N+BB[4]+CC[4]/N,kap3),N,2),polynom)); |
> | FF[4]:=factor(coeff(kap34,N,1)); |
So I have derived asymptotic approximations of the first three cumulants at all 4 critical points. Denote the critical points by P1, P2,P3,P4.
> | P1:=[0,0,0]; |
> | P2:=[AA[2]*N+BB[2]+CC[2]/N,DD[2]*N^2+EE[2]*N,FF[2]*N^3]; |
> | P3:=[AA[3]*N+BB[3]+CC[3]/N,DD[3]*N^2+EE[3]*N,FF[3]*N^3]; |
> | P4:=[AA[4]*N+BB[4]+CC[4]/N,DD[4]*N+EE[4],FF[4]*N]; |
I would also like to study the local stability of the 4 critical points. I do this by evaluating the eigenvalues of the jacobian matrices evaluated at each of the four critical points...
> | F:=[eq1,eq2,eq3]; |
> | J:=Jacobian(F,[kappa1,kappa2,kappa3]); |
Determine the Jacobian in each of the four critical points:
> | J1:=subs(kappa1=P1[1],kappa2=P1[2],kappa3=P1[3],J); |
Recall AA:
> | AA; |
> | J2:=subs(kappa1=P2[1],kappa2=P2[2],kappa3=P2[3],J): |
> | J3:=subs(kappa1=P3[1],kappa2=P3[2],kappa3=P3[3],J): |
> | J4:=subs(kappa1=P4[1],kappa2=P4[2],kappa3=P4[3],J): |
Determine the eigenvalues of the matrices J1-J4.
The computations are demanding. So I modify each of the matrices J2-J4 by replacing each of its elements by the first (one or) two terms in its asymptotic approximation as N aproaches infinity.
The modification of J2 is called J2a:
> | J2a:=J2: |
> | J2a[1,1]:=map(factor,convert(asympt(J2[1,1],N,1),polynom)); |
> | J2a[1,2]; |
> | J2a[1,3]; |
> | J2a[2,1]:=simplify(convert(asympt(J2[2,1],N,0),polynom)); |
> | J2a[2,2]:=simplify(convert(asympt(J2[2,2],N,1),polynom)); |
> | J2a[2,3]; |
> | J2a[3,1]:=simplify(convert(asympt(J2[3,1],N,-1),polynom)); |
> | J2a[3,2]:=simplify(convert(asympt(J2[3,2],N,0),polynom)); |
> | J2a[3,3]:=simplify(convert(asympt(J2[3,3],N,1),polynom)); |
The modification of J3 is called J3a:
> | J3a:=J3: |
> | J3a[1,1]:=simplify(convert(asympt(J3[1,1],N,1),polynom)); |
> | J3a[1,2]; |
> | J3a[1,3]; |
> | J3a[2,1]:=simplify(convert(asympt(J3[2,1],N,0),polynom)); |
> | J3a[2,2]:=simplify(convert(asympt(J3[2,2],N,1),polynom)); |
> | J3a[2,3]; |
> | J3a[3,1]:=convert(asympt(J3[3,1],N,-1),polynom); |
> | J3a[3,2]:=convert(asympt(J3[3,2],N,0),polynom); |
> | J3a[3,3]:=map(factor,convert(asympt(J3[3,3],N,1),polynom)); |
Modify J4:
> | J4a:=J4: |
> | J4a[1,1]:=simplify(convert(asympt(J4[1,1],N,1),polynom)); |
> | J4a[1,2]; |
> | J4a[1,3]; |
> | J4a[2,1]:=simplify(convert(asympt(J4[2,1],N,1),polynom)); |
> | J4a[2,2]:=simplify(convert(asympt(J4[2,2],N,1),polynom)); |
> | J4a[2,3]; |
> | J4a[3,1]:=simplify(convert(asympt(J4[3,1],N,1),polynom)); |
> | J4a[3,2]:=simplify(convert(asympt(J4[3,2],N,1),polynom)); |
> | J4a[3,3]:=convert(asympt(J4[3,3],N,1),polynom); |
The eigenvalues of the 4 matrices:
> | eg1:=Eigenvalues(J1): |
> | eg2:=Eigenvalues(J2a): |
> | eg3:=Eigenvalues(J3a): |
> | eg4:=Eigenvalues(J4a): |
Determine asymptotic approximations of the eigenvalues!
> | a1:='a1': |
> | eg11a:=evalc(convert(asympt(eg1[1],N,3),polynom)): |
> | assume(a1>0); eg11b:=simplify(eg11a); |
> | a1:='a1': eg12a:=evalc(convert(asympt(eg1[2],N,2),polynom)): |
> | assume(a1>0); eg12b:=simplify(eg12a); |
> | a1:='a1': eg13a:=evalc(convert(asympt(eg1[3],N,3),polynom)): |
> | assume(a1>0); eg13b:=simplify(eg13a); |
The three eigenvalues are asymptotically K, 2K, 3K. All of them positive. So the origin (P1) is unstable.
Next consider the eigenvalues of the matrix J2.
> | a1:='a1': |
> | eg21a:=evalc(convert(asympt(eg2[1],N,3),polynom)): |
> | assume(a1>0); eg21b:=evalf(simplify(eg21a)); |
> | a1:='a1': eg22a:=evalc(convert(asympt(eg2[2],N,3),polynom)): |
> | assume(a1>0); eg22b:=evalf(simplify(eg22a)); |
> | a1:='a1': eg23a:=evalc(convert(asympt(eg2[3],N,3),polynom)): |
> | assume(a1>0); eg23b:=evalf(simplify(eg23a)); |
The eigenvalues are, asymptotically, 3.46K, -K, K. Hence the critical point P2 is unstable.
Now look at the eigenvalues of J3.
> | a1:='a1': |
> | eg31a:=evalc(convert(asympt(eg3[1],N,3),polynom)): |
> | assume(a1>0); eg31b:=evalf(map(simplify,eg31a)); |
> | a1:='a1': eg32a:=evalc(convert(asympt(eg3[2],N,3),polynom)): |
> | assume(a1>0); eg32b:=evalf(map(simplify,eg32a)); |
> | a1:='a1': eg33a:=evalc(convert(asympt(eg3[3],N,3),polynom)): |
> | assume(a1>0); eg33b:=evalf(map(simplify,eg33a)); |
So the eigenvalues of J3 are: K, -3.46 K, -K. Unstable critical point!
Now look at the eigenvalues of J4.
> | a1:='a1': eg41a:=evalc(convert(asympt(eg4[1],N,3),polynom)): |
> | assume(a1>0); eg41b:=map(simplify,eg41a); |
> | a1:='a1': eg42a:=evalc(convert(asympt(eg4[2],N,3),polynom)): |
> | assume(a1>0); eg42b:=map(simplify,eg42a); |
> | a1:='a1': eg43a:=evalc(convert(asympt(eg4[3],N,3),polynom)): |
> | assume(a1>0): eg43b:=map(simplify,eg43a); |
The eigenvalues of J4 are asymptotically -K, -3K, -2K. Thus P4 is stable.