# hw2 - pick α 1 = α 2 = β 1 = β 2 = 1 and start with any...

This preview shows pages 1–2. Sign up to view the full content.

Homework 2 PHZ 5156 Due Thursday September 10 1. The Lotka-Volterra model is often also referred to as the “predator-prey equa- tions”. These are two coupled nonlinear diﬀerential equations that can only be solved numerically. The equations for this model are given below: dx dt = α 1 x - α 2 xy dy dt = β 1 xy - β 2 y a) Find the stable critical points where dx dt = 0 and dy dt = 0 in terms of the coeﬃcients α 1 , α 2 , β 1 , and β 2 . The trivial stable point is x = 0, y = 0. b) Write a computer code in Fortran 77 or Fortran 90 to numerically solve the Lotka-Volterra model. Use two approaches and compare. First, try the ordinary Euler algorithm discussed in class. Second, try the “midpoint method”, which is essentially a 2nd order Runge-Kutta approach (see Eq. A.15 and A.16 in Giordano). In particular, you can ﬁnd x n +1 and y n +1 from, x n +1 = x n + Δ t ( α 1 x 0 - α 2 x 0 y 0 ) y n +1 = y n + Δ t ( β 1 x 0 y 0 - β 2 y 0 ) where x 0 and y 0 are given by, x 0 = x n + Δ t 2 ( α 1 x n - α 2 x n y n ) y 0 = y n + Δ t 2 ( β 1 x n y n - β 2 y n ) 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Make a picture of the populations x and y vs. time. Have both populations plotted on the same graph, with the plot extending through at least 5 oscillations. You can
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: pick α 1 = α 2 = β 1 = β 2 = 1, and start with any initial populations x and y that are away from the stationary points. 2. Consider the equation of a damped, driven simple harmonic oscillator d 2 y dt 2 + 2 q dy dt + ω 2 y = A cos ωt a) Find the analytical solution for y ( t ), neglecting the homogeneous solution describ-ing transient behavior. b) Write a Fortran 77 or Fortran 90 code that uses the Verlet algorithm to determine y ( t ). Also in your code, compute the analytical solution y ( t ) at each time step for comparison. Determine a suitable time step so that the numerical and analytical solutions agree. Determine the resonant frequency where the amplitude is maximum. Run your simulation at exactly the resonant frequency. Hand in a plot of y ( t ) from your code that includes both the analytical and numerical results. 2...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

hw2 - pick α 1 = α 2 = β 1 = β 2 = 1 and start with any...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online