2nd order Runge-Kutta for 1st order quadratic ODE

36 Views Asked by At

I can't solve the following ODE with Runge-Kutta.

$$\dfrac{dv}{dt}=32-2v^{2}, \quad v(0)=3.8$$

with step size $h=0.1$. Could someone help me?

1

There are 1 best solutions below

0
On

For the DE

$$ y'=f(y,t)\Rightarrow\cases{k_1=f(y_j,t_j)\\ k_2=f(y_j+k_1\frac h2, t_j+\frac h2)\\ y_{j+1}= y_j+k_2 h} $$

here $f(y,t) = f(v) = 32-2v^2$ then

$$ \cases{ k_1 = 32-2v_j^2\\ k_2 = 32-2(v_j+k_1\frac h2)^2\\ v_{j+1} = v_j + k_2 h } $$

Follows a plot with $h=0.05$

enter image description here