User:Egm6341.s11.team4.hylon/hw7

= Problem 7.3 Solve logistic equation using inconsistent Trapezoidal-Simpson Algorithm =

Given
Refer to Lecture note S10 41-2 for more detailed problem statement

The logistic equation for population dynamics is given in S10 38-3,


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \dot{x}(t) = f(x) = rx \left(1-\frac{x}{x_{max}}\right) $$ $$
 * $$\displaystyle
 * }.
 * }.

Where, $$\displaystyle x_{max}=10;\ r = 1.2,\ $$ and $$\displaystyle t \in [0,10] $$

And the analytical solution is given by,


 * {| style="width:100%" border="0" align="left"

$$\displaystyle x(t) = \frac{x_0x_{max}e^{rt}}{x_{max} + x_0(e^{rt}-1)} $$ $$
 * $$\displaystyle
 * }.
 * }.

Find
Integrate the population function using the inconsistent Trapezoidal-Simpson Algorithm given by,


 * {| style="width:100%" border="0" align="left"

$$\displaystyle z_{i+1/2} = \frac{1}{2} [z_{i} + z_{i+1}] $$
 * }.
 * }.

Two initial conditions, $$\displaystyle x_0=2\ and\ x_0 = 7,\ $$.

Solution
The Hermite-Simpson algorithm behaves better than inconsistent Trapezoidal-Simpson algorithm, that the error is much smaller comparing to inconsistent Trapezoidal-Simpson algorithm. Below are the plots for comparing Hermite-Simpson algorithm with Trapezoidal-Simpson algorithm.

Reference
S10.Team4