Numerical Analysis, Numerical Methods, Stability Test.
the Euler method def euler(f, y0, t, dt): y = np.zeros(len(t)) y[0] = y0 for i in range(1, len(t)): y[i] = y[i-1] + dt*f(y[i-1]) return y # Generate synthetic data y0 = 1.0 t = np.arange(0, 10, 0.01) dt_list = [0.1, 0.01, 0.001, 0.0001] y_true_data = y_true(t, y0) euler_data = {} for dt in dt_list: