Professional Documents
Culture Documents
Eulers Method Stiff Problem
Eulers Method Stiff Problem
• At t=0, the first term is 1 and the second term is 0; as soon as t increases, the first term
quickly becomes 0 and then only the second term is present.
• Away from a very small layer region near 0, the exact solution looks like sin(t).
• Looks like Euler’s method should have no problem with this simple looking solution.
• Here is a Scliab script that uses Euler’s method to solve this problem. We will step from
0 to 8 with a step size of 0.1. That will give us a good sense of what the solution is.
0.
- 98.999833
9800.9842
- 970297.43
96059446.
- 9.510D+09
9.415D+11
.
.
.
5.69D+111
- 5.63D+113
5.58D+115
- 5.52D+117
5.47D+119
- 5.41D+121
• Whoops!
• Let’s try again with a step size h = 0.05.
ee =
0.
- 48.999979
2400.9991
- 117648.95
5764798.7
- 2.825D+08
.
.
.
- 2.29D+265
1.12D+267
- 5.51D+268
2.70D+270
- 1.32D+272
ee =
ee =
0.
- 23.999997
575.99995
- 13823.999
331775.97
- 7962623.3
1.911D+08
.
.
.
- 1.84D+302
4.43D+303
- 1.06D+305
2.55D+306
- Inf
Nan
Nan
Nan
Nan
.
.
.
• It turns out that by reducing the step size to be much smaller than you would expect
that you would need to compute a numerical solution that is (basically) sin(t), one can
obtain good results.
• Why does h have to be so small, given how simple the solution looks?