Class Practice 3

Student Name:                               Student ID:                                  Seat number:

Purpose:  Learn how to use Matlab built in functions ODE23,  ODE45 to solve ODE-IVP system.
The contents are from Lesson 9-10.  Use reverse side if necessary.

Answer the following questions and fill in the blank spaces.

  • Let y1(t) be the population of a prey and y2(t) be the population of a predator, write down the differential equations model.

  •  
     
     
  • Consider the differential equation:              y1 ' =   a y1  -  b  yy2

  •                                                                      y2 ' = - c y2 +  d y1 y2

    where  a, b, c, d are parameters.  Is the system autonomous? Complete and correct the following Matlab  code to define the function of the right hand side.

    function yp = prey_prd(t, y);
    global a b c d
    k = length(      )  ;
    yp =        (k,   ) ;
    yp(1) = a y 1  - b*y(1) y 2  ;
    prey_prd(2) = -c *y 1  +  d*y 1  y 2  ;
    How should we name this file?
     
  • Assume y1(0)=100,  y2(0) =  80;  a= c = 0.5, b= d=0.01;  tfinal = 50, write a drive Matlab file called lesson9_10.m to solve the problem using Matlab built in function  ode23  or  ode45. Plot and label  versus time. What happens if we take  a= d= 0.5, b= c=0.01?

  •  

     
     

  • Use a separate window to get the phase plot. What is a phase plot?

  •  
     
  • Write down the equations that determines the steady state solutions (equilibrium) of the problem above.  Can you guess or solve the equations? Are they stable, unstable, or  limit cycles? Do the equilibrium depend on the initial conditions?

  •