MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Linearization of a system of differential equations

  • To: mathgroup at
  • Subject: [mg829] Re: Linearization of a system of differential equations
  • From: rknapp (Robert Knapp)
  • Date: Mon, 24 Apr 1995 03:06:39 -0400
  • Organization: Wolfram Research, Inc.

In article <3n1sja$avv at> alves at (Ivan Boris Alves) writes:

> I am in the process of exploring some systems of differential equations.  
> The questions I have a fairly simple, such as determining whether a 
> unique equilibrium is saddle point stable or not.  
> Does anybody know of packages that simplify this process?
> ANy help would be appreciated

A package I wrote last year for undergraduate differential equations
projects may help.  Here are some examples--the (short) package is at
the end of this post.

The project conatining the examples below and many others are
available via anonymous ftp from

The examples are for the Lorenz equations.

Find the critical points for the Lorenz equations (with r a parameter)

In[1]:= Clear[x,y,z];v={x,y,z};
f={s*(y-x), -x*z+r*x-y, x*y-b*z}
                                           8 z
Out[1]= {10 (-x + y), r x - y - x z, x y - ---}
In[2]:= {c0,cm,cp}=ReplaceAll[v,#]& /@ Solve[f == {0,0,0},v]
               Sqrt[-8 + 8 r]     Sqrt[-8 + 8 r]
{{0, 0, 0}, {-(--------------), -(--------------), 
                  Sqrt[3]            Sqrt[3]
             Sqrt[-8 + 8 r]  Sqrt[-8 + 8 r]
   -1 + r}, {--------------, --------------, -1 + r}}
                Sqrt[3]         Sqrt[3]

LOAD the Package

In[3]:= <<Bifurcation.m;

Linearize around the critical point at {0,0,0} (the output is a matrix)
In[4]:= a0=Linearize[f,v,c0]

The linearized system is:
x' == -10 x + 10 y
y' == r x - y
      -8 z
z' == ----
Out[4]= {{-10, 10, 0}, {r, -1, 0}, {0, 0, -(-)}}

This plots the eigenvalues of the matrix as a function of the
parameter r (for c.c. pairs, the imag parts are plotted greeen adn the
real part is plotted blue)

In[5]:= EigenPlot[a0,{r,0,100}];

Linearize about the critical point "ap"

In[30]:= ap=Linearize[f,v,cp]

The linearized system is:
x' == -10 x + 10 y
              Sqrt[-8 + 8 r] z
y' == x - y - ----------------
      Sqrt[-8 + 8 r] x   Sqrt[-8 + 8 r] y   8 z
z' == ---------------- + ---------------- - ---
          Sqrt[3]            Sqrt[3]         3

                         Sqrt[-8 + 8 r]
{{-10, 10, 0}, {1, -1, -(--------------)}, 
   Sqrt[-8 + 8 r]  Sqrt[-8 + 8 r]    8
  {--------------, --------------, -(-)}}
      Sqrt[3]         Sqrt[3]        3

Again, you can plot the eigenvalues with EigenPlot.  Interesting
regions to look at are for r between 1.32 and 1.36 (a bifurcation from
two real eigenvalues to a c.c. pair occurs) and r between 24.732 and
24.753 (the real part of the c.c. pair becomes positive, making this
critical point unstable-which eventually sets the stage for chaos at a
slightly higher value of r.

Here is the package:


EigenPlot::usage="EigenPlot[a,{r,r1,r2,nr},opts]  produces    a plot   of    the
eigenvalues of  the matrix a  as  a function  of the bifurcation  parameter r by
sampling at nr points between r1 and r1.  Real eigenvalues are plotted in red.  For complex eigenvalues, the real part is plotted in blue and the imaginary part is plotted in green.  Valid options are any Graphics option and Tolerance: if Tolerance->tol, then if Abs[Im[lambda]]< tol, the eigenvalue is considered real.  The default is Tolerance->10^(-12)."

Linearize::usage="Linearize[f,v,vc]  produces  a linearization of  the system of
DE's v[[1]]'=f[[1]],etc. at the critical point vc.  The output is the matrix for
the linear system."



   If[Length[fin] == 0,f={fin}];
   If[Length[vin] == 0,v={vin};vc->{vcin}];
   matrix=Table[(D[f[[i]],#]& /@ v),{i,1,Length[f]}] /. Thread[v->vc];
   sys=Simplify[f /. Thread[v->vc]]+matrix.v;
   Print["The linearized system is:"];

      tol = Tolerance /. {opts} /. Options[EigenPlot];
      Do[evals=Eigenvalues[N[a /. r->rr]];
            If[Abs[Im[ev]] < tol,
      If[Length[real] > 0,AppendTo[points,{{RGBColor[1,0,0],(Point /@ real)}}]];
      If[Length[cre] > 0,points=Join[points,{{RGBColor[0,0,1],(Point /@ cre)}},
                                         {{RGBColor[0,1,0],(Point /@ cim)}}]];


  • Prev by Date: a plug for Block, Re: mg[758]
  • Next by Date: Re: ODE solver
  • Previous by thread: a plug for Block, Re: mg[758]
  • Next by thread: Linearization of a system of differential equations