In this section we solve simple differential equations. These will serve as an example of the concept of an initial value problem and the methods of solution, as well as provide a fist look at the accuracy of the numerical solutions.
Radioactive Decay
Arguably the simplest differential equation is the one describing Radioactive Decay.
This equation is
The function gives the number of radioactive nuclei remaining in
a sample at time
. It is derived via a probability argument.
is the probability per unit time for a nucleus to decay.
This constant is fitted
to decay data of the nucleus being described. The model describes the
number of
radioactive nuclei remaining in the sample at all time given
, the number of
radioactive nuclei initially at time
. The half life of a
radioactive
species is the time at which only 1/2 of the radioactive nuclei
remain in the
sample.
The exact solution of this equation is:
Here is how Maple exactly solve this equation: Radioactive_decay.mw
Exercise #1: Write a C code to solve this equation via the Euler and the Mid-Point methods. Compare these numerical solution to the exact solution. Here are the steps you may want to follow:
The code radiactive_decay.c compares both the Euler and Mid-Point solutions to the exact solution of this problem.
Aids Epidemics
Under epidemics conditions, the number of sick individuals,
, in a population sample containing a total
of
individuals
is given as a crude first approximation by the equation
Exercise #2: Solve this equation for given
,
, and
.
Use a time range
and
. Solve the differential equation
via the Euler and the Mid-Point methods. Plot these solutions
simultaneously.
Exercise #3: The solution of a differential equation can be checked via direct replacement of the solution in the equation and checking whether the LHS equals the RHS. Do this for the Euler and Mid-Point solutions above. Here are the steps to follow:
The exact solution of this differential equation can be obtained. Here is a Aids_epidemic.mw illustrating how.
Fixed Point
The following differential equation has an interesting solution.
Exercise #4: Numerically solve this differential equation