This problem has two parts. In part one, we will extend what we know about Runge-Kutta methods to systems of equations. In the second, we will use pplane to examine some two-dimensional phase-planes, similar to our use of dfield to draw direction fields.
To do the second part of the assignment you need to download some additional programs, following the instructions here.
- If you chose to work with the MATLAB-based programs in assignment one, then you already have everything you need. The only difference in the instructions is that you type pplane2 at the MATLAB prompt (after the characters >> ).
- If you used the Java versions of the programs, available here, make sure you download and run the program named pplane.jar.
Runge-Kutta with two or more dependent variables is exactly the same as with one dependent variable. Suppose we have a system of two equations. Instead of calling the variables and , let's call them and . To solve a system of the form
we define a sequence of times and a sequence of approximations , along with the obvious modification to the Euler updating rule:
In the attached MATLAB-generated webpage, I solve the system
with initial condition from to . Note that I plot the solution twice. The first graph shows both and as functions of . The second graph shows the trajectory in the with initial condition , .)-$plane.
In Section 7.1 of Boyce and DiPrima, you learn how to convert a second-order equation
into a system of equations second order equations. In this assignment you will be considering the forced damped pendulum equations:
(We have chosen our units to make the problem as simple-looking as possible.)
- (Pencil and paper) Rewrite this as a system of two first order equations, suitable for solving using the Euler method.
- Modify the example program to solve the undamped, unforced system obtained by setting and from to with initial condition , . If you choose time step , you will find a strange result: the amplitude of the pendulum's motion will grow slowly over time! (You know this shouldn't happen because the system conserves energy. That means the solutions should be periodic, and should look like closed curves trajectories are viewed in the plane. Instead, you should see a spiral.) Experiment with the value of to make the spiraling effect disappear, at least to the accuracy visible to the naked eye on your plots. Plot the trajectory and state how small a value of you used.
- Using the same value of , solve the system with the same initial conditions but , , and . Run the simulation up to . Describe what you see.
- Now increase the forcing to . Describe what you see. This is an example of mathematical chaos.
Using the phase plane program described in the introduction, plot the phase plane for the Lotka-Volterra model
Here represents the population of a prey species, say mice, and is the population of a predator species, for example owls. If there are no owls, then the population of of mice grows exponentially, and if there are no mice, then the owls die off. However if the initial populations are both positive, then interesting stuff happens. Plot the phase plane including a number of solutions of this system with . You decide what is are good limits for your axes. Describe the solutions in a few words. Do you think that this model gives realistic behavior?