You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems, for small mu values (< 100) , errors for the eph are extremely high / computations become numerically unstable?
The following snippet:
importpykepaspkimportnumpyasnp# Pick some test epoch, problem persists for anytest_epoch=pk.epoch(0)
# Define central body elements, problem persists for anyelements= (1,0,0,0,0,0)
# Some r,v, for orbiting Satr= [1000,0.1,0.1]
v= [0.1,0.1,0.1]
# Define central body mu, problems exists only for small MUfortest_planet_muinnp.logspace(-5, 5, 11):
# Define planettest_planet=pk.planet.keplerian(test_epoch,elements,pk.MU_SUN,test_planet_mu,1,1,"test")
# Define orbiting satellitetest_satellite=pk.planet.keplerian(test_epoch,r,v,test_planet.mu_self,0,1,1,"test_sat")
r_test,v_test=test_satellite.eph(test_epoch)
# Compute the difference between the twor_diff=np.linalg.norm(np.array(r_test) -np.array(r))
v_diff=np.linalg.norm(np.array(v_test) -np.array(v))
print(f"For mu = {test_planet_mu:<10} the difference in r and v is {r_diff:<10.4e} and {v_diff:<10.4e}")
produces
For mu = 1e-05 the difference in r and v is 1.8149e+03 and 1.0162e-07
For mu = 0.0001 the difference in r and v is 8.0696e+03 and 5.9027e-07
For mu = 0.001 the difference in r and v is 3.9075e+01 and 2.3072e-07
For mu = 0.01 the difference in r and v is 1.1187e+03 and 3.5445e-05
For mu = 0.1 the difference in r and v is 8.5343e+01 and 1.4133e-03
For mu = 1.0 the difference in r and v is 2.3625e+03 and 9.1964e-03
For mu = 10.0 the difference in r and v is 6.3135e+03 and 6.9916e-02
For mu = 100.0 the difference in r and v is 1.5194e-12 and 5.9691e-16
For mu = 1000.0 the difference in r and v is 1.2010e-11 and 6.8129e-14
For mu = 10000.0 the difference in r and v is 2.4689e-11 and 1.6205e-12
For mu = 100000.0 the difference in r and v is 1.0816e-09 and 7.2581e-10
@darioizzo maybe this is expected as numerical instability? But then a warning when creating keplerian planets with small MU would be really nice, I think?
(This is pykep 2.6 from conda on windows fwiw)
The text was updated successfully, but these errors were encountered:
It seems, for small mu values (< 100) , errors for the eph are extremely high / computations become numerically unstable?
The following snippet:
produces
@darioizzo maybe this is expected as numerical instability? But then a warning when creating keplerian planets with small MU would be really nice, I think?
(This is pykep 2.6 from conda on windows fwiw)
The text was updated successfully, but these errors were encountered: