CSC 210
Week 6
Topics:
-
Error analysis of the Euler algorithm: Local error proportional
to h^2, global error is proportional to h.
Wikipedia: Euler's Algorithm
- Runge-Kutta (4) algorithm: Local error is proportional
to h^5, global error is proportional to h^4.
Wikipedia: Runge-Kutta
- Dormand-Prince algorithm:
Read the entry in PHASER Help and also see
Wikipedia:
Dormand-Prince_method
- How to compute e: comparison of several algorithms.
- 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.
Assignment:
-
A culture of 8 bacteria are placed in a test tube, and their
numbers is counted daily. At first, when their numbers was small
they grew at a rate of %180 per day. After a few days, their numbers
stabilized at about 405.
-
Assuming that the bacteria grows according
to the logistic model x'=ax - bx^2, determine the numerical
values of the coefficients a and b.
-
Find the equilibrium points of the logistic ODE with your parameter
values and determine their stability properties from the Linerazation
Theorem.
-
Using Phaser, determine how long it takes for the bacteria culture
to grow to within %10 of the carrying capacity.
-
Consider the differential equation x'= -10x.
Show, using the Linearization Theorem, that x=0 is an
asymptotically stable equilibrium point.
Now, in the XiVsTime View of Phaser, compute several
solutions starting near the equilibrium point using Euler's
algorithm with various step sizes. Use a large graph point size and connect points.
Determine the largest
step size that results in a picture where the origin
looks like an asmyptotically stable point.
Hint: h = 0.3 does not give a correct picture.
- Use PHASER for solving
the initial-value problem x' = x, x(0) = 1 at t=1, that
is x(1)= e = 2.7182818284590452354 with several algorithms as follows.
You should open the Console in the Numerics Editor to get the stats
for your computations:
- First use Runge-Kutta with step h = 0.01.
Note that you get at least 8 digits correct to the right of the decimal.
How long does your computation take?
- Now determine the "largest" step size in the Improved Euler algorithm
to get the same number of correct digits. How long does it take to compute?
- Now determine the "largest" step size in the Euler algorithm
to get 8 correct digits. How LOooooNG does it take to compute?
-
Here we consider the "explosion" problem x'= x^2, x(0)=1.
This simple equation shows up in chemical reactions where two atoms
get together to form a molecule.
-
Verify that the solution of this initial-value problem is x(t) = 1/(1-t).
-
Using Euler's Algorithm with steps h = 0.01 and h = 0.005,
compute x(0.9). What is the error in your computations?
Hint: Note that the exact value of x(0.9) = 1/(1- 0.9).
-
Now in Phaser, compute x(1) with Euler
using steps h = 0.01 and h = 0.005. What is the error in your calculations?
-
Nonautonomous Euler:
When the right-hand-side of a differential equation
contains time t explicitly, the equation is called nonautonomous.
Now, consider a differential equation of the form
dx/dt = f (t, x) with x(0) = x_0.
Then Euler becomes
x_(n+1) = x_n + h*f(x_n, t_n)
t_(n+1) = t_n + h .
Now, in the Gompertz equation
x' = a*(exp(-b*t))*x,
set a = 3 and b = 2, and x(0) = 5; and take step size h = 0.1.
By hand compute two steps of Nonutonomous Euler on Gompertz and compare your numbers
to the ones you get from PHASER.