kill(all)$

biotech:Fisher Equation( = pde),phase plane analysis :part 2,version 1.0
peter.vlasschaert@gmail.com,11/05/2020

see :website
==========
--------------------------------------------------------------------------------------------------------------------------
biotech:Fisher Equation( = pde),intro (relation dimensional,non dimensional) ,version 1.0
→          Fisher Equation( = pde),travelling wave propagation :part 1,                 version 1.0
-------------------------------------------------------------------------------------------------------------------------
FE = Fisher Equation

load package
==========

load(lrats)$

D = diffusion >0, r =rate constant > 0

nonlinear ode,c = wave speed
------------------------------------------------------------------------

p1:'diff(U,z,1)*c+'diff(U,z,2)+(1-U)*U=0;

→ result p1 : nonlinear ode ,D=1

see :website
------------------
biotech :appendix 3: limits of fisher equation (-∞,0,∞),version 1.0
=================================================

limit :z → -∞   ,U(z) =1, one         steady state
limit :z →  ∞   ,U(z) =0 , second  steady state
--------------------------------------------------------------

p1a:limit(U(z),z,minf) = 1;
p1b:limit(U(z),z,inf)    = 0;

 ================================================

depends(U,z);

depends(V,z);

Phase Plane Analysis
==================

→ step1:(U,V) phase plane
--------------------------------------

p2a:'diff(U,z) = V;
p2ab:rhs(p2a);
p2a1:diff(p2a,z);
p2b:solve(p1,'diff(U,z,2))[1];
p2b1:subst([p2a,p2a1],p2b);
p2b2:lhs(p2b1) = factorsum(rhs(p2b1));
p2b2a:rhs(p2b2);

function : maxima :{f1,f2}
---------------------------------

p2ba:f[1](U,V,c):=''p2ab;

p2b2aa:f[2](U,V,c):=''p2b2a;

p2b2ab:[f[1](U,V,c),f[2](U,V,c)];

derivative
--------------

p2ca:lhs(p2a)    = f[1](U,V,c);
p2cb:lhs(p2b2)  = f[2](U,V,c);

→ step2:(U,V) phase plane trajectories
------------------------------------------------------

p2d:p2b1/p2a;

p2d1:lhs(p2d) = 'diff(V,U);

p2d2:subst([p2d1],p2d);

→ step3:jacobian= J
-----------------------------
W =matrix

yy:[U,V];

=>  jacobian function

p2e2a:W[ii,jj]:=diff(f[ii](U,V,c),yy[jj]);

 => jacobian matrix

p2e2b:J =genmatrix(W,2,2);

→step4: fixed points
-----------------------------

p2f1:makelist(f[k](U,V,c),k,1,2);

p2f2:solve(p2f1,yy);

result : two fixed points

→ first  :fixed point

p2f3a:p2f2[2];

→ J 

p2f3a1:subst(p2f3a,p2e2b);

→ second :fixed point

p2f3b:p2f2[1];

→ J 

p2f3b1:subst(p2f3b,p2e2b);

why : c=2,limiting value, choose :here ,D =1
-----------------------------------------------------------
see : biotech :appendix 1: second order ode : coef D,c  ,version  1.0
c=2*sqrt(D) =2*sqrt(1) =2

first fixed point:J,c =2,(U,V) = (0,0)
--------------------------------

p2f4a:subst([c=2],p2f3a1);

second fixed point:J,c =2,(U,V) = (1,0)
--------------------------------

p2f4a:subst([c=2],p2f3b1);

p2g:subst([c=2],p2b2ab);

→ step5 : use x,y for plotdf

legend :U =x , V=y

p2h:subst([U=x,V=y],p2g);
/*plotdf(p2h,[xradius,2],[yradius,2])*/

linear stability analysis
=================

use :menu:Algebra :Enter Matrix

Id: matrix(
 [1,0], 
 [0,1]
);

first fixed point, (U,V)=(0,0)
====================
use :p2f3a1

→  find eigen values :

p3a:'determinant(rhs(p2f3a1)-λ*Id)=ev(determinant(rhs(p2f3a1)-λ*Id),nouns);

p3a1:rhs(p3a)=0;

p3a2:solve(p3a1,λ);

c=2

p3a3:subst([c=2],p3a2),float;

→ when both values p3a3 are negativ : stable

---------------------------------------------------------------------------

analysis :sqrt ,sqrt(c^2-4),c^2 ?4

→stable node  : c^2 ≥4                ,see figure 1
→stable spiral : c^2 <4,complex ,see figure 1, go to origon(0,0), UV plane

second fixed point, (U,V)=(0,1)
========================
use :p2f3b1

→  find eigen values :

p3b:'determinant(rhs(p2f3b1)-λ*Id)=ev(determinant(rhs(p2f3b1)-λ*Id),nouns);

p3b1:rhs(p3b)=0;

p3b2:solve(p3b1,λ);

use : c =2

p3b3:subst([c=2],p3b2),float;

→ when one value neg & other positiv :unstable

----------------------------------------------------------------------------

analysis :sqrt ,sqrt(c^2+4),c^2 +4 >0

→ saddle point, see figure 1