A simple example of a stiff linear IVP:
>
|
|
| (1) |
>
|
|
| (3) |
| (4) |
Issue the following command to see a plot of the solution.
>
|
|
Trying to solve this IVP with the stiff=false option is too expensive. From the general solution of this equation, , we see that the solution of the IVP is very stable because all solutions come together exponentially fast. And, after an initial transient, the solution of the IVP approaches the slowly varying solution .
We can solve this same example with the backfull option for lsode, which by default asks for more accuracy than rosenbrock.
>
|
|
| (6) |
| (7) |
The van der Pol equation in relaxation oscillation is a famous example of a stiff nonlinear problem.
>
|
|
| (10) |
>
|
|
| (11) |
>
|
|
| (12) |
Issue the following command to see a plot of the solution that shows regions of sharp change.
>
|
|
If you experiment with other initial conditions, you will see that all non-trivial solutions converge very rapidly to this limit cycle. The IVP is stiff where the solution is slowly varying.
A stiff nonlinear system from reactor kinetics:
>
|
|
| (13) |
>
|
|
| (14) |
>
|
|