diff --git a/figures/elliptical_orbit.png b/figures/elliptical_orbit.png index 4b973cc..718a9a5 100644 Binary files a/figures/elliptical_orbit.png and b/figures/elliptical_orbit.png differ diff --git a/ias15PDE.py b/ias15PDE.py index 5913726..f1581df 100644 --- a/ias15PDE.py +++ b/ias15PDE.py @@ -54,12 +54,18 @@ def push(func: callable, gunc: callable, xi, yi, dt, Bx = np.zeros(7), By = np.z Output: xn - new position x yn - new position y''' - - for i in range(12): + for i in range(20): xh, yh = calculateNodePositions(Bx, By, xi, yi, func, gunc, dt, hp = h) Fx, Fy = calculateDerivatives(xh, yh, func, gunc) Gx, Gy = calculateGFromF_xy(Fx, Fy) - Bx, By = calculateB_xy(Gx, Gy) + Bxf, Byf = calculateB_xy(Gx, Gy) + diff_Bx = Bx - Bxf + diff_By = By - Byf + total_diff = np.sqrt(np.sum(diff_Bx**2) + np.sum(diff_By**2)) + Bx = Bxf + By = Byf + if total_diff < 1e-16: + break xn, yn = calculateNewPosition(Bx, By, xi, yi, func, gunc, dt) return xn, yn, Bx, By diff --git a/regression_elipse.py b/regression_elipse.py index 9f8fda0..8aa44c7 100644 --- a/regression_elipse.py +++ b/regression_elipse.py @@ -9,7 +9,7 @@ y0 = 0 ds = .001 -s_final = np.pi*2 +s_final = np.pi*2/100 nSteps = int(s_final/ds) s = np.linspace(0,s_final,nSteps+1, endpoint=True) x = np.zeros(nSteps+1)