CSC 210

Week 7


Topics:


Assignment:

  1. Consider the "explosion" problem x'= x^2, x(0)=1, and try to compute x(1). As we saw last week, the solution of this initial-value problem is given by the formula x(t) = 1/(1-t). Therefore, the value of x(1) is infinite.

    Now in Phaser, compute this number using steps h = 0.01 and h = 0.005 and algorithms Euler, Improved Euler, Runge-Kutta4, Dormand-Prince5(4), and Dormand-Prince8(5,3). Following the golden rule

    What to do in practice: In real life applications, it is impossible to be certain if numerically generated solutions of differential equations are reliable, or how large the errors might be. The golden rule of practice is to compute the same solution using several algorithms with various step sizes. If the variations in these computations are large (more than you can accept for a particular application) your problem is most likely a dangerous one. If the variations in these computations are small enough, most likely you get a reliable answer out of the machine.

    conclude that this problem is indeed dangerous to compute.

    Next, In the Dormand-Prince 5(4), set the step h = 0.01 and decrease the Absolute error and Relative error from 1.0E-7 until Phaser refuses to compute the value x(1). What is the smallest error tolerance for which PHASER refuses to compute infinity? Monitoring the Console in the Numericas Editor, report at which t value PHASER stops computations for your set tolerances.

  2. Logistic model with Harvesting: Supposed that a fish population grows according to Logistic differential equation but also harvested at a constant rate:
    x' = r x1 (1 - x1/k) - h
    where r is the growth rate, k is the carrying capacity and h is the harvesting rate. In the Xi vs Time view, first set r=1.02, k=2, and h = 0, and plot about a dozen inital conditions and get the familiar picture.
    Now increase the harvesting rate from 0 to 0.75 with increments of 0.05 and create a gallery of 16 pictures. Note that as the harvesting is increased, some initial conditions will start becoming negative, and eventually all your solutions might become negative. This is extinction cuased by overfishing. Explore the values of H and initial conditions when extinction happens. Note that for a given h, some small initial conditions might go extinct while larger initial conditions might survive. However, for large h, all initial conditions cannot avoid extinction. Please report your findings from a biological viewpoint.

  3. One step of Runge-Kutta(4): Consider the initial value problem x1' = x, x(0)=1. With step size h = 1, compute, by hand using paper and pencil, one step of Runge-Kutta(4) algorithm to obtain the approximate value of x(1). Make sure you show all the intermediate numbers Ks. Now compare your answer with the one you get from Phaser.

  4. Another predator-prey model: Recall that in class we considered the predator-prey system
    x1' = ax1 - bx1 x2
    x2' = -cx2 + dx1 x2
    where we assume that in the absence of the other, each species grows exponentially. We observed that both populations oscillate for almost all initial conditions.
    Now, let us modify this model by assuming that prey (x1) grows according to the logistic model, leaving other assumptions the same as before. Then the model becomes:
    x1' = rx1(1 - x1/k) - bx1 x2
    x2' = -cx2 + dx1 x2
    Enter these equtions into Phaser. For simplicity, let us fix r=1.1, k=1, b=1, c=1, and d=1. In the Phase portrait view, plot many initial conditions and determine what happens to prey and predator.
    Now, leaving the other parameters fixed, change c from 0 to 2. Describe what happens to the populations.
    Next, vary d from 0 to 2 while keeping the other parameters fixed at 1. Describe your findings.