Lets consider I have a system of 4 ODE: dX/dt = F(X), where X is a vector(4-demension) and F: R^4 -> R^4. F is called vectorDE_total_function, and I'm trying to calculate the solution using RK-4.
def solvingDES():
previous_vector = np.array ([theta_1, omega_1, theta_2, omega_2]);
for current_time in time:
temp_vector = previous_vector;
RK_vector = np.array([0.0,0.0,0.0,0.0]);
for c in [6,3,3,6]:
RK_vector = vectorDE_total_function(previous_vector + c * RK_vector/6) * time_step;
temp_vector += RK_vector / c;
previous_vector = temp_vector;
current_time += 1;
And it looks like I'm wrong somewhere, but I'm not sure where. Is it seems legit?