Projekt aufgeräumt, gha1 getestet, Runge-Kutta angepasst (gha2_num sollte jetzt deutlich schneller sein)
This commit is contained in:
21
GHA_biaxial/rk.py
Normal file
21
GHA_biaxial/rk.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import runge_kutta as rk
|
||||
from numpy import sin, cos, tan
|
||||
import winkelumrechnungen as wu
|
||||
from ellipsoide import EllipsoidBiaxial
|
||||
import numpy as np
|
||||
|
||||
def gha1(re: EllipsoidBiaxial, x0, y0, z0, A0, s, num):
|
||||
phi0, lamb0, h0 = re.cart2ell(0.001, wu.gms2rad([0, 0, 0.001]), x0, y0, z0)
|
||||
|
||||
def buildODE():
|
||||
def ODE(s, v):
|
||||
phi, lam, A = v
|
||||
dphi = cos(A) * re.V(phi) ** 3 / re.c
|
||||
dlam = sin(A) * re.V(phi) / (cos(phi) * re.c)
|
||||
dA = tan(phi) * sin(A) * re.V(phi) / re.c
|
||||
return np.array([dphi, dlam, dA])
|
||||
return ODE
|
||||
|
||||
_, funktionswerte = rk.rk4(buildODE(), 0, np.array([phi0, lamb0, A0]), s, num)
|
||||
coords = re.ell2cart(funktionswerte[-1][0], funktionswerte[-1][1], h0)
|
||||
return coords
|
||||
Reference in New Issue
Block a user