Runge Kutta 3 ODE
49 views (last 30 days)
Part of bigger project. The task:
4. Implement the Runge-Kutta-3 (RK3) solver in Matlab and use it to compute the time evolution of the positions of the three bodies. For an ODE in general form y 0 = f(t, y) the RK3 method is defined as follows:
K1 = hf(ti , yi)
K2 = hf(ti + 1 2 h, yi + 1 2K1)
K3 = hf(ti + h, yi − K1 + 2K2)
yi+1 = yi + 1 6 (K1 + 4K2 + K3) where ti = t0 + ih.
As the name suggests, it is of third order accuracy.
Our code so far:
We have tried putting n=different numbers but dont know what we are doing.
Array indices must be positive integers or logical values.
Error in RK3 (line 7)
What is the problem and how do solve the error?