Runge Kutta method example

478 Views Asked by At

enter image description here

Hi, can someone plz explain where the formulas for $w_{i+1}$ come from? Thanks!

1

There are 1 best solutions below

7
On BEST ANSWER

The iteration formula for the Midpoint Rule is given by:

$\tag 1 w_{i+1} = w_i + h f\left(t_i + \dfrac{h}{2}, w_i +\dfrac{h}{2} f\left(t_i, w_i\right)\right), w_0 = \alpha = 0.5, N = 10, h = 0.2, t_i = 0.2i$

We have:

  • $f(t, y) = y-t^2 + 1$
  • $t_i + \dfrac{h}{2} = 0.2 i + 0.1$
  • $f(t_i, w_i) = w_i - t_i^2 + 1 = w_i -(0.2i)^2 + 1 = w_i -0.04 i^2 + 1$

From $(1)$, we have:

$$w_{i+1} = w_i + 0.2 f \left(0.2 i + 0.1, w_i + 0.1(w_i -0.04 i^2 + 1) \right) \\ =w_i + .2(1.1~ w_i -0.044i^2 -0.04 i + 1.09 )$$

Hence:

$$w_{i+1} = 1.22 w_i - 0.0088i^2 - 0.008 i + 0.218$$

Give the second one a go.