Homework and Report
for Lesson 9:
Your Name:
Student ID:
Your seat row No.
Use the reverse side or additional
paper if necessary.
1. (15 points). Describe
the one predator and one prey model. Identify the independent variable
and dependent variables. Explain the meanings of parameters.
2. (5 points). Consider the
following fox and rabbit model with no harvesting
y1' = -b y1 + c y1 y2,
y2' = d y2 - e y1 y2,
with variable initial conditions [ y1(0) y2(0)]'.
Write a matlab function to define the right hand
side of the differential equation; write a matlab M-file
to solve the equation using Matlab built in function ode23
or ode45. Attach your Matlab code(s). Hint: see
format_f.m or yprf.m, and
lesson9.m for examples.
3. (30 points) Numerical
Experiments. Take b=0.5, c=0.01, d=0.4, e=0.01,
t0=0, tfinal=50, and y1(0)=100+10*(1+0.S
), where S is your student ID. Solve the problem use your Matlab code with
y2(0)=90, 1, 40 respectively (i.e. three different cases). Plot
the solutions versus time and the phase plot. Label all the plots
(title, xlable, and ylable). Explain the solutions you obtained.
4. (Extra Credit
for 5 points.) We can use the Euler's method and improved Euler's
method to solve the ODE system as well. This is useful if we do not have
Matlab, we can use other computer languages. In my_euler.m
and main_eluer.m, the Euler's
method for solving an ODE system is given. Modify the code
to use improved Euler's method to solve the ODE system. Mark
your changes. Use you code to solve the problem above with one group
of parameters and plot the solutions.