Math 325:  Differential Equations,  Assignment 2,    April 1,  1998
Due to April 24, 1998.

Names (up to 3 students):

Problem 1

1. First, using Mathematica define the coefficient matrix: 

x1'[t] =  13  x1[t] +4  x2[t] 
x2'[t] =    4  x1[t] + 7 x2[t] 
x1[0] = 11,  x2[0] = 23

Using Mathematica we define the coefficient matrix:

A = { {13,4}, {4,7} };

and the initial vector: 

X0 =  { {11}, {23} };

2. Then a fundamental matrix for the system:  x' = Ax  is given by: 

fundamental = MatrixExp[ At ]

Hence the particular solution can be calculated as follows:

solution = fundamental . x0;
Simplify [ solution ]

b) Plot the particular solution in the phase space (x1,x2)

c) Solve the initial value problem

x1'[t]  =  -149 x1[t]  - 50 x2[t]  -  154 x3[t]x2'[t]  =     537 x1[t]  +  180  x2[t]  +  546 x3[t]\(\(x3'\)[t]\  = \ \ \ \ \(-27\)\ x1[t]\  - 9  x2[t]\  - 25\ x3[t], 

    x1[0]\  = \ 17, \ \ x2[0]\  = \ 43, \ \ x3[0]\  = \ 79. \)

Solution

************************************************************

Problem 2

Consider a first order differential equation of the form:  

dy/dx  =  (2x[t] y[t] -y^2[t]) / (x^2[t] -2x[t] y[t]) /

which is difficult to solve explicitly. Its solution curves can be plotted as trajectories of the corresponding
autonomous two-dimensional system:

x'[t]  = x^2[t] -2x[t] y[t]
y'[t] = 2x[t] y[t] -y^2[t].

a) Plot  some solution curves for the equation (1).

b) Construct an example of your own:  dy/dx = G(x,y)/F(x,y) and plot solution curves.

Solution

************************************************************

Problem 3

The term "bifurcation" generally refers to something "splitting apart". With regard to differential equations or
systems involving parameter, it refers to abrupt changes in the character of the solutions as the parameter 
is changed continuously. The following problem illustrates a sensitive case in which a small  perturbation
in the coefficients of a linear system can change the type or stability of a critical point.

a) Consider the linear system:

(2)     x'[t] = e x[t] - y[t]        
          y'[t] = x[t] + e y[t].

Show that the critical point (0,0) is

a) a stable spiral point if e<0

b) a center if e=0

c) an unstable spiral point if e>0

Thus small perturbations of the system

x'[t] =  - y[t]
y'[t] = x[t]

can change both the type and stability of the critical point.

d) Plot phase portraits of the system (2) with e= -0.2, -0.05, 0, 0.05, 0.2
    and indicate stability in each case. You can use Mathematica code from Problem 5.

Solution

************************************************************

Problem 4

Interesting and complicated phase portraits often result from simple nonlinear perturbations of linear systems.
Consider the following nonlinear system:

x'[t] = -x[t] - y^2[t] Cos[x+y]
y'[t] = y[t] + x^2[t] Cos[x-y].

This system has a lot of critical points. Suppose that we want to locate accurately the apparent spiral point near (-1,1).
Our problem is to solve numerically two equations in two unknown. 
Using Mathematica we could proceed as follows.

a)

\(\(xp\  = \ \(-x\)\  - \ y^2\ Cos[x + y]; 

    yp\  = \ y\  + \ x^2\ Cos[x - y]; 

    soln\  = \ 
      FindRoot[\ {xp\  == 0, \ yp\  == 0}, \ {x, \(-1\)}, \ {y, 1}\ ]; 

    a\  = \ x /. \ soln; \ b\  = \ y\  /. \ soln; 
{a, b}
\)\)

This should result in an approximate value of the critival point.

b) To investigate the precise nature of this critical point, we need to substitute u=x-a, v=y-b
so that x=a, y=b correspond to u=0, v=0. The right-hand sides of the resulting equations for du/dt and dv/dt will
be given by
    subs = {x -> u + a, y -> v + b};
    up = xp /. subs
    vp = yp /. subs

We can extract the coefficients of the u- and v-terms by computing partial derivatives of up and vp at the origin

    A = {{D[up,u], D[up,v]},
    {D[vp,u], D[vp,v]}} /. {u -> 0, v -> 0}

Calculate the  eigenvalues of this matrix A by using the following command and determine the type and stability
of the critical point.

Eigenvalues[A]

Solution

Problem 5

a) Plot phase  portrait of the predator-prey system:

y1'[t]  = 2  y1[t] - a y1[t]  y2[t]
y2'[t] = -  y2[t] + a y1[t] y2[t]

using the following Mathematica code:

Clear[y1, y2]\(tmin = 0; 
tmax = 30; 
l1 = 1; 
l2 = 2; 
g1 = 2; 
g2 = 1; 

    a = \ 0.01; 
y10 = \ 100; 
y20 = 50; 
\ \ 
    Sol\  = \ \ \ \ \ 
      NDSolve[{\(y1'\)[t] == \ 2\ \ y1[t]\  - \ a\ y1[t]\ \ y2[t], 

          \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
          \(y2'\)[t] == 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
            \(-\ \ y2[t]\)\  + \ a\ y1[t]\ y2[t], 
y1[0] == y10, 

          \ \ \ \ \ \ y2[0]\  == y20}, {y1[t], y2[t]}, {t, tmin, tmax}]; 

    y1[t_]\  = \ y1[t]\  /. \ Sol; 
y2[t_]\  = \ y2[t]\  /. \ Sol; 

    p8 = \ ParametricPlot[Evaluate[{y1[t], y2[t]} /. Sol]\ , 
        \ {t, tmin, tmax}]\)

b) Plot graphs of several particular solutions (y1[t],y2[t]) of the predator-prey system as functions  of  time t  using the following Mathematica code and choosing different initial conditions y10 and y20:

Clear[y1, y2]\(tmin = 0; 
tmax = 30; 
l1 = 1; 
l2 = 2; 
g1 = 2; 
g2 = 1; 

    a1 = 1; 
a2 = 1; 
y10 = \ 2; 
y20 = 2; 
\ \ 
    ss\  = \ \ \ \ \ 
      NDSolve[{\(y1'\)[t] == \ 
            \((l1\  - \ g1)\)\ \ y1[t]\  + \ a1\ y1[t]\ \ y2[t], 

          \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
          \(y2'\)[t] == 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
            \((l2\  - \ g2)\)\ \ y2[t]\  - \ a2\ y1[t]\ y2[t], 

          y1[0] == y10, 
\ \ \ \ \ \ y2[0]\  == y20}, {y1[t], y2[t]}, {t, 
          tmin, tmax}]; 

    p1\  = \ Plot[Evaluate[\ y1[t]\  /. \ ss\ ], {t, tmin, 
\ \ \ \ tmax}]; 
    
p2\  = \ 
      Plot[Evaluate[\ y2[t]\  /. \ ss\ ], {t, tmin, 
\ \ \ \ tmax}]; 

    Show[p1, p2]; \)

c) Find the period of a particular solution with initial conditions: y10 = 2, y20 = 2 using its graph.