Sunteți pe pagina 1din 1

26.1.

Variable step for differential equations 63

26.1. Variable step for differential equations

A new algorithm has been added for adjusting the step according to the variations of the curve.
The parameter method has a new possible value : varrkiv to activate the Runge-Kutta method with
variable step, then the parameter varsteptol (real value; .01 by default) can control the tolerance
of the algortihm.
b

1b

RK ordre 4 : ε < 10−1


b

b RK ordre 4 : ε < 10−2

RK ordre 4 : ε < 10−3


b

RK ordre 4 : ε < 10−4


b b
b

b
solution exacte
b
b
b

b
b
b
b b
b
b
b
b b
b b b b b b b b b b b b b b b b b b b b b b b b b
b
b
b
b
b b b b b b b b b b b b b b
b

b
b
0 b b b b b b b b b b

0 1 2 3 4 5 6 7 8 9 10

Figure 1: Equation y = −y with y0 = 1.

\def\Funct{neg}\def\FunctAlg{-y[0]}
\psset{xunit=1.5, yunit=8, showpoints=true}
\begin{pspicture}[showgrid=true](0,0)(10,1.2)
\psplot[linewidth=6\pslinewidth, linecolor=green, showpoints=false]{0}{10}{Euler x neg
exp}
\psplotDiffEqn[linecolor=magenta, method=varrkiv, varsteptol=.1, plotpoints
=2]{0}{10}{1}{\Funct}
\rput(0,.0){\psplotDiffEqn[linecolor=blue, method=varrkiv, varsteptol=.01, plotpoints
=2]{0}{10}{1}{\Funct}}
\rput(0,.1){\psplotDiffEqn[linecolor=Orange, method=varrkiv, varsteptol=.001, plotpoints
=2]{0}{10}{1}{\Funct}}
\rput(0,.2){\psplotDiffEqn[linecolor=red, method=varrkiv, varsteptol=.0001, plotpoints
=2]{0}{10}{1}{\Funct}}
\psset{linewidth=4\pslinewidth,showpoints=false}
\rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}
\rput*[l](3.3,.9){\small RK ordre 4 : $\varepsilon<10^{-1}$}
\rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}
\rput*[l](3.3,.8){\small RK ordre 4 : $\varepsilon<10^{-2}$}
\rput*(3.3,.7){\psline[linecolor=Orange](-.75cm,0)}
\rput*[l](3.3,.7){\small RK ordre 4 : $\varepsilon<10^{-3}$}
\rput*(3.3,.6){\psline[linecolor=red](-.75cm,0)}
\rput*[l](3.3,.6){\small RK ordre 4 : $\varepsilon<10^{-4}$}

S-ar putea să vă placă și