【发布时间】:2016-12-11 02:41:53
【问题描述】:
假设我有一个 4 ODE 系统:dX/dt = F(X),其中 X 是向量(4 维),F:R^4 -> R^4。 F被称为vectorDE_total_function,我正在尝试使用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;
看起来我在某个地方错了,但我不确定在哪里。看起来合法吗?
【问题讨论】:
标签: python numpy numerical-methods runge-kutta