RungeKutta1 Runge Kutta Method 실습 (1일차) import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint h = 0.05 # step size t = np.arange(0, 100+h, h) # time u = np.zeros_like(t) # position u[0] = -0.5 # initial condition def F_ut(u, t): return 1 * np.exp(-u) - 0.1 * t # velocity is dependent on time t and position x # Runge-Kutta method for i in range(len(t)-1): # calculation loop k1 = F_ut(u[i], t[i]) k2 = F_u.. 2024. 2. 22. 이전 1 다음