Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Runge Kutta methods and stability

Curtiss and Hirschfelder problem

We consider the following problem :

{dty(t)=k(cos(t)y(t)))withk>1y(0)=y0\left\{ \begin{aligned} {\mathrm d}_t y(t) & = k \, \big(cos(t) - y(t)) \big) \quad \text{with} \quad k > 1\\ y(0) & = y_0 \end{aligned} \right.

and in the following, we will assume t0=0t_0=0.

Runge Kutta methods

Order 1 (Forward Euler)

uini = 2.
tini = 0.
tend = 1.5
k = 50.
plot_sol_and_error(uini, tini, tend, k, order=1)
Loading...

Order 2 (RK2)

uini = 2.
tini = 0.
tend = 1.5
k = 50.
plot_sol_and_error(uini, tini, tend, k, order=2)
Loading...

Ordre 3 (RK3)

uini = 2.
tini = 0.
tend = 1.5
k = 50.
plot_sol_and_error(uini, tini, tend, k, order=3)
Loading...

Ordre 4 (RK4)

uini = 2.
tini = 0.
tend = 1.5
k = 50.
plot_sol_and_error(uini, tini, tend, k, order=4)
Loading...