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
{{ message }}
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
There is no traceback. This is numerical issue with cowell propagator. The results below show the initial condition and delta times (in minutes) for propagation comparison to show the numerical issue with cowell (only) across all nine Poliastro 2-Body propagators using the farnocchia propagator as the reference.
The initial conditions y0 are: sv_epoch.iso=2022-12-13 13:21:34.561
pos(km),vel(km/sec) SV=[ -6858.92754616 22880.34051724 -12385.72355668] km [-1.96342222 -1.99145606 -2.60788909] km / s
The 19 delta times are in minutes relative to the y0 epoch above are:
delta times from y0=
[-300. -266.66666667 -233.33333333 -200. -166.66666667
-133.33333333 -100. -66.66666667 -33.33333333 0.
33.33333333 66.66666667 100. 133.33333333 166.66666667
200. 233.33333333 266.66666667 300. ] min
The results for each propagator are shown using the L2 norm (in meters) of position vector for that propagator and position vector for farnocchia for each of the 19 times. Only cowell differs by a significant (i.e., 6.4e+26) amount.
Comment below about what you've started working on.
Add, commit, push your changes
Submit a pull request and add this in comments - Addresses #<put issue number here>
Ask for a review in comments section of pull request
Celebrate your contribution to this project 馃帀
The code changes to core/propagation/cowell.py shown in function "cowell_fix" below should resolve the issue. Output of cowell_fix results with comparison to other propagators (same initial conditions as documented in problem detail) is shown at the end. [[I also have a cowell_fix_vector version that seems to be ~40% faster which uses t_eval of solve_ivp if that is of interest). The version below closely matches the original except handles the case when tofs have pos/neg values relative to y0 epoch.]]
def cowell_fix(k, r, v, tofs, rtol=1e-11, *, events=None, f=func_twobody):
x, y, z = r
vx, vy, vz = v
u0 = np.array([x, y, z, vx, vy, vz])
def solve_ivp_helper(t_span, h_tofs):
result = solve_ivp(
fun=f,
t_span=t_span,
y0=u0,
args=(k,),
rtol=rtol,
atol=1e-12,
method=DOP853,
dense_output=True,
events=events,
)
if not result.success:
raise RuntimeError("Integration failed")
if events is not None:
# Collect only the terminal events
terminal_events = [event for event in events if event.terminal]
# If there are no terminal events, then the last time of integration is the
# greatest one from the original array of propagation times
if not terminal_events:
last_t = max(tofs)
else:
# Filter the event which triggered first
last_t = min(event._last_t for event in terminal_events)
# FIXME: Here last_t has units, but tofs don't
tofs = [tof for tof in tofs if tof < last_t] + [last_t]
rrs = []
vvs = []
for i in range(len(h_tofs)):
t = h_tofs[i]
y = result.sol(t)
rrs.append(y[:3])
vvs.append(y[3:])
# rrs = np.transpose(result.y[:3, :])
# vvs = np.transpose(result.y[3:, :])
return rrs, vvs
if tofs.size == 1:
# If size is 1, there cannot be values on either side of t0.
return solve_ivp_helper(t_span=(0, tofs), h_tofs=tofs)
else:
# If tofs include both positive and negative values we must integrate
# separately due to constraints of solve_ivp requiring initial condition
# at epoch t0, where t_span=(t0, tf) where tf could be positive or negative.
tofs_neg = tofs[tofs < 0.0]
tofs_pos = tofs[tofs >= 0.0]
if tofs_neg.size > 0:
rrs, vvs = solve_ivp_helper(t_span=(0.0, np.min(tofs_neg)), h_tofs=tofs_neg)
if tofs_pos.size > 0:
rrsP, vvsP = solve_ivp_helper(t_span=(0, np.max(tofs_pos)), h_tofs=tofs_pos)
if tofs_neg.size > 0:
# pass
# breakpoint()
rrs = np.concatenate((rrs, rrsP))
vvs = np.concatenate((vvs, vvsP))
else:
rrs = rrsP
vvs = vvsP
return rrs, vvs
---- class overide below to test cowell_fix. --------
class CowellPropagator(PoliastroCowellPropagator):
def propagate(self, state, tof):
state = state.to_vectors()
tofs = tof.reshape(-1)
rrs, vvs = cowell_fix(
state.attractor.k.to_value(u.km**3 / u.s**2),
*state.to_value(),
tofs.to_value(u.s),
self._rtol,
events=self._events,
f=self._f,
)
r = rrs[-1] << u.km
v = vvs[-1] << (u.km / u.s)
new_state = RVState(state.attractor, (r, v), state.plane)
return new_state
def propagate_many(self, state, tofs):
state = state.to_vectors()
rrs, vvs = cowell_fix(
state.attractor.k.to_value(u.km**3 / u.s**2),
*state.to_value(),
tofs.to_value(u.s),
self._rtol,
events=self._events,
f=self._f,
)
# TODO: This should probably return a RVStateArray instead,
# see discussion at https://github.com/poliastro/poliastro/pull/1492
return (
rrs << u.km,
vvs << (u.km / u.s),
)
Results using the cowell_fix function below using same initial conditions:
馃悶 Problem
There is no traceback. This is numerical issue with cowell propagator. The results below show the initial condition and delta times (in minutes) for propagation comparison to show the numerical issue with cowell (only) across all nine Poliastro 2-Body propagators using the farnocchia propagator as the reference.
The initial conditions y0 are: sv_epoch.iso=2022-12-13 13:21:34.561
pos(km),vel(km/sec) SV=[ -6858.92754616 22880.34051724 -12385.72355668] km [-1.96342222 -1.99145606 -2.60788909] km / s
The 19 delta times are in minutes relative to the y0 epoch above are:
delta times from y0=
[-300. -266.66666667 -233.33333333 -200. -166.66666667
-133.33333333 -100. -66.66666667 -33.33333333 0.
33.33333333 66.66666667 100. 133.33333333 166.66666667
200. 233.33333333 266.66666667 300. ] min
The results for each propagator are shown using the L2 norm (in meters) of position vector for that propagator and position vector for farnocchia for each of the 19 times. Only cowell differs by a significant (i.e., 6.4e+26) amount.
e2bSat.method=<correlator.geometry.twobody.CowellPropagator object at 0x14d3ef550>
prop_diff_mag7=[6.41937015e+26 2.81465344e+26 1.10530340e+26 3.75711300e+25
1.04854225e+25 2.19895543e+24 2.93525775e+23 1.71794560e+22
1.34216313e+20 1.70892835e+04 6.33717797e+03 5.86487302e+02
8.80663979e+01 1.84472924e+02 1.90934283e+01 4.17819664e+00
3.47481321e+00 2.40914180e+00 1.77257689e-04]
e2bSat.method=<poliastro.twobody.propagation.danby.DanbyPropagator object at 0x14d3ef760>
prop_diff_mag7=[9.37889539e-06 8.21289650e-07 1.07759340e-08 3.14741652e-08
2.18417273e-07 8.89761971e-08 1.01371460e-09 3.24896772e-07
5.74349235e-06 1.41943984e-05 1.38654895e-05 6.18781225e-06
3.91653789e-07 2.26730137e-08 5.44771397e-08 2.06767962e-07
3.89456432e-08 1.40829733e-08 7.16486586e-07]
e2bSat.method=<poliastro.twobody.propagation.farnocchia.FarnocchiaPropagator object at 0x14d3eeaa0>
prop_diff_mag7=[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
e2bSat.method=<poliastro.twobody.propagation.gooding.GoodingPropagator object at 0x14d3eead0>
prop_diff_mag7=[0.00000000e+00 4.17965238e-09 5.06857301e-10 5.73443576e-09
5.73443576e-09 1.64709127e-08 4.17965238e-09 4.09426515e-09
1.19084502e-08 4.53346952e-09 2.23017213e-08 2.02742921e-09
9.12343142e-09 2.28704439e-08 1.72033073e-08 2.02742921e-09
2.86721788e-09 8.66118136e-09 3.35993732e-08]
e2bSat.method=<poliastro.twobody.propagation.markley.MarkleyPropagator object at 0x14d3ee860>
prop_diff_mag7=[9.06693904e-09 0.00000000e+00 0.00000000e+00 9.06693904e-09
0.00000000e+00 2.58049609e-08 1.01371460e-09 4.05485841e-09
0.00000000e+00 2.02742921e-09 2.86721788e-09 5.73443576e-09
1.01371460e-09 4.56171571e-09 9.29084780e-09 0.00000000e+00
4.05485841e-09 1.01371460e-09 4.68507262e-08]
e2bSat.method=<poliastro.twobody.propagation.mikkola.MikkolaPropagator object at 0x14d3ee7a0>
prop_diff_mag7=[9.06693904e-09 4.17965238e-09 0.00000000e+00 0.00000000e+00
7.30999996e-09 1.64709127e-08 4.17965238e-09 4.07066689e-09
1.49673167e-08 4.17965238e-09 3.73289305e-08 2.86721788e-09
9.34598685e-09 2.26730137e-08 8.10971682e-09 0.00000000e+00
2.02742921e-09 8.66118136e-09 3.35993732e-08]
e2bSat.method=<poliastro.twobody.propagation.pimienta.PimientaPropagator object at 0x14d3ee080>
prop_diff_mag7=[0.00000000e+00 4.17965238e-09 5.06857301e-10 5.73443576e-09
5.73443576e-09 1.64709127e-08 4.17965238e-09 4.07066689e-09
1.49673167e-08 4.05485841e-09 3.54655265e-08 2.86721788e-09
4.60208566e-08 1.76459150e-07 3.42773469e-07 4.83617304e-08
4.88236146e-06 2.79447798e-05 1.08598437e-04]
e2bSat.method=<poliastro.twobody.propagation.recseries.RecseriesPropagator object at 0x14d3ed570>
prop_diff_mag7=[0.00500154 0.14758535 0.02721475 0.29855354 0.04438455 0.14259895
0.01727641 0.11050271 0.33731653 0.64837285 0.01131748 0.83810392
0.55781191 0.22144075 0.03032468 0.04470962 0.04386429 0.26307067
0.61246696]
e2bSat.method=<poliastro.twobody.propagation.vallado.ValladoPropagator object at 0x14d3edfc0>
prop_diff_mag7=[4.53346952e-09 6.08228762e-09 4.60348104e-08 1.15278562e-07
1.51569826e-07 8.23296039e-08 1.58347283e-08 1.02773442e-08
1.14800661e-08 1.16466941e-08 2.66666677e-08 1.09180404e-08
1.60362473e-08 1.57325926e-07 3.86734446e-07 5.85702507e-07
4.94991765e-07 2.40111309e-07 2.25223797e-08]
馃枼 Please paste the output of following commands
conda info -a
(only if you have conda)conda list
(only if you have conda)pip freeze
# Paste your output here: pip freeze anyio @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/croot-t_zs64wy/anyio_1644482593257/work/dist appnope @ file:///Users/ktietz/ci_310/appnope_1643965056645/work argon2-cffi @ file:///opt/conda/conda-bld/argon2-cffi_1645000214183/work argon2-cffi-bindings @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/croot-wbf5edig/argon2-cffi-bindings_1644845754377/work astropy==5.2.2 astroquery==0.4.6 asttokens @ file:///opt/conda/conda-bld/asttokens_1646925590279/work attrs @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_978y9aqcd7/croot/attrs_1668696180911/work Babel @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_00k1rl2pus/croot/babel_1671781944131/work backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work beautifulsoup4 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_croot-15cbtalq/beautifulsoup4_1650462161715/work black==23.3.0 bleach @ file:///opt/conda/conda-bld/bleach_1641577558959/work brotlipy==0.7.0 cached-property @ file:///home/conda/feedstock_root/build_artifacts/cached_property_1615209429212/work certifi==2022.12.7 cffi @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_ab19r4bji3/croot/cffi_1670423206034/work cftime @ file:///Users/ktietz/ci_310/cftime_1644261743672/work charset-normalizer @ file:///tmp/build/80754af9/charset-normalizer_1630003229654/work click==8.1.3 comm @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_b19kb7be6_/croot/comm_1671231124262/work contourpy @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_97c8ctlp86/croots/recipe/contourpy_1663827422071/work -e git+https://github.com/marcodlk/correlator.git@41a6bffc150576365450fecff48a3b3820f24f3b#egg=correlator coverage==7.2.3 cryptography @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_a9zjqvif1f/croot/cryptography_1677533099634/work cycler @ file:///tmp/build/80754af9/cycler_1637851556182/work czml3 @ file:///home/conda/feedstock_root/build_artifacts/czml3_1639548540228/work debugpy @ file:///Users/ktietz/ci_310/debugpy_1643965577625/work decorator @ file:///opt/conda/conda-bld/decorator_1643638310831/work defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work entrypoints @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_croot-jb01gaox/entrypoints_1650293758411/work exceptiongroup==1.1.1 executing @ file:///opt/conda/conda-bld/executing_1646925071911/work fastjsonschema @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_43a0jaiddu/croots/recipe/python-fastjsonschema_1661368628129/work flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core fonttools==4.25.0 html5lib @ file:///home/conda/feedstock_root/build_artifacts/html5lib_1592930327044/work idna @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_771olrhiqw/croot/idna_1666125579282/work imageio==2.29.0 importlib-metadata @ file:///home/conda/feedstock_root/build_artifacts/importlib-metadata_1679167925176/work importnb @ file:///home/conda/feedstock_root/build_artifacts/importnb_1673967369578/work iniconfig==2.0.0 ipykernel @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_bappucl7zp/croot/ipykernel_1671488382153/work ipython @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_37ui4fx2bi/croot/ipython_1676582229363/work ipython-genutils @ file:///tmp/build/80754af9/ipython_genutils_1606773439826/work jaraco.classes @ file:///home/conda/feedstock_root/build_artifacts/jaraco.classes_1667024629799/work jedi @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/croot-f1t6hma6/jedi_1644315882177/work Jinja2 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_9fjgzv9ant/croot/jinja2_1666908141308/work jplephem @ file:///home/conda/feedstock_root/build_artifacts/jplephem_1664394079882/work json5 @ file:///tmp/build/80754af9/json5_1624432770122/work jsonschema @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_d9tjy9j5w9/croot/jsonschema_1676558687376/work jupyter-server @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_c8338fkvq6/croot/jupyter_server_1671707627219/work jupyter_client @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_aen57n2aow/croot/jupyter_client_1676329104065/work jupyter_core @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_41npretn_h/croot/jupyter_core_1676538590424/work jupyterlab @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_8eoq8791j4/croot/jupyterlab_1675354128675/work jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work jupyterlab_server @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_78w72gxv4j/croot/jupyterlab_server_1677143065891/work keyring @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_8bd22k84zo/croot/keyring_1678999224442/work kiwisolver @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_93o8te804v/croot/kiwisolver_1672387163224/work llvmlite==0.39.1 loguru==0.7.0 lxml @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_71bcfe2b-fe7b-414a-9d7e-4f32bdd95f6d2vxca0jd/croots/recipe/lxml_1657545136492/work MarkupSafe @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_12c133f5-0720-4727-9c18-599a3af825723lzwham3/croots/recipe/markupsafe_1654597866058/work matplotlib @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_c08pvf1yzu/croot/matplotlib-suite_1677674309145/work matplotlib-inline @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_f6fdc0hldi/croots/recipe/matplotlib-inline_1662014472341/work mistune @ file:///Users/ktietz/ci_310/mistune_1643966732634/work more-itertools @ file:///home/conda/feedstock_root/build_artifacts/more-itertools_1677514956219/work munkres==1.1.4 mypy-extensions==1.0.0 nbclassic @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_1f2l5sjrt5/croot/nbclassic_1676902898198/work nbclient @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_croot-08wgx75f/nbclient_1650373566605/work nbconvert @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_36au3u9s44/croot/nbconvert_1668450648628/work nbformat @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_94781rq_cg/croot/nbformat_1670352348390/work nest-asyncio @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_6b_e0dr4lw/croot/nest-asyncio_1672387130036/work netCDF4 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_36k3vzik6u/croot/netcdf4_1673455467939/work notebook @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_92n14lq88x/croot/notebook_1668179891126/work notebook_shim @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_f8mr1gjfb7/croot/notebook-shim_1668160580414/work numba @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_c3qabuog69/croot/numba_1670258334066/work numpy @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_d18vvv3mag/croot/numpy_and_numpy_base_1672336185310/work packaging @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_952b3b8pj8/croot/packaging_1671697425767/work pandas==2.0.1 pandocfilters @ file:///opt/conda/conda-bld/pandocfilters_1643405455980/work parso @ file:///opt/conda/conda-bld/parso_1641458642106/work pathspec==0.11.1 pexpect @ file:///tmp/build/80754af9/pexpect_1605563209008/work pickleshare @ file:///tmp/build/80754af9/pickleshare_1606932040724/work Pillow==9.4.0 platformdirs @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_f7wx6m2jsp/croots/recipe/platformdirs_1662711384790/work plotly @ file:///home/conda/feedstock_root/build_artifacts/plotly_1677271849976/work pluggy==1.0.0 poliastro @ file:///home/conda/feedstock_root/build_artifacts/poliastro_1657532809185/work pooch @ file:///home/conda/feedstock_root/build_artifacts/pooch_1679580333621/work prometheus-client @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_25sgeyk0j5/croots/recipe/prometheus_client_1659455103277/work prompt-toolkit @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_0blbsngvis/croot/prompt-toolkit_1672387317724/work psutil @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_1310b568-21f4-4cb0-b0e3-2f3d31e39728k9coaga5/croots/recipe/psutil_1656431280844/work ptyprocess @ file:///tmp/build/80754af9/ptyprocess_1609355006118/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl pure-eval @ file:///opt/conda/conda-bld/pure_eval_1646925070566/work pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work pyerfa @ file:///Users/ktietz/ci_310/pyerfa_1644262685380/work Pygments @ file:///opt/conda/conda-bld/pygments_1644249106324/work pymap3d @ file:///home/conda/feedstock_root/build_artifacts/pymap3d_1678001215509/work pyOpenSSL @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_38h4axtq38/croot/pyopenssl_1677607699670/work pyparsing @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_3b_3vxnd07/croots/recipe/pyparsing_1661452540919/work pyrsistent @ file:///Users/ktietz/ci_310/pyrsistent_1643962172005/work PySocks @ file:///Users/ktietz/ci_310/pysocks_1643961536721/work pytest==7.3.1 pytest-datadir==1.4.1 python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work pytz @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_c56ru3yml9/croot/pytz_1671697451306/work pyvo @ file:///home/conda/feedstock_root/build_artifacts/pyvo_1678251954978/work PyYAML @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_8dd_9u21zz/croot/pyyaml_1670514759576/work pyzmq @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_8599562e-e9e5-443b-91db-7f7c0ba6aad3mrdoyvz4/croots/recipe/pyzmq_1657724196154/work requests @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_b15e28ca-768e-4951-b4c6-8a7476e43183hrjpnkg9/croots/recipe/requests_1657734638595/work scipy==1.10.0 Send2Trash @ file:///tmp/build/80754af9/send2trash_1632406701022/work sgp4==2.21 six @ file:///tmp/build/80754af9/six_1644875935023/work skyfield==1.46 sniffio @ file:///Users/ktietz/ci_310/sniffio_1643964335533/work soupsieve @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_d2jpk7eoyp/croot/soupsieve_1666296398381/work stack-data @ file:///opt/conda/conda-bld/stack_data_1646927590127/work tenacity @ file:///home/conda/feedstock_root/build_artifacts/tenacity_1677600641219/work terminado @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_fcfvyc0an2/croot/terminado_1671751835701/work tinycss2 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_fcw5_i306t/croot/tinycss2_1668168825117/work tomli @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_d0e5ffbf-5cf1-45be-8693-c5dff8108a2awhthtjlq/croots/recipe/tomli_1657175508477/work tornado @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_a61b4xoie9/croots/recipe/tornado_1662061692951/work traitlets @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_6301rd5qbe/croot/traitlets_1671143894285/work typing_extensions @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_10a8_u2ijw/croot/typing_extensions_1669923788997/work tzdata==2023.3 urllib3 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_8fvc4z_gis/croot/urllib3_1673575619550/work w3lib @ file:///home/conda/feedstock_root/build_artifacts/w3lib_1670599828182/work wcwidth @ file:///Users/ktietz/demo/mc3/conda-bld/wcwidth_1629357192024/work webencodings==0.5.1 websocket-client @ file:///Users/ktietz/ci_310/websocket-client_1643972661291/work zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1677313463193/work
馃挕 Possible solutions
馃搵 Steps to solve the problem
Addresses #<put issue number here>
The code changes to core/propagation/cowell.py shown in function "cowell_fix" below should resolve the issue. Output of cowell_fix results with comparison to other propagators (same initial conditions as documented in problem detail) is shown at the end. [[I also have a cowell_fix_vector version that seems to be ~40% faster which uses t_eval of solve_ivp if that is of interest). The version below closely matches the original except handles the case when tofs have pos/neg values relative to y0 epoch.]]
def cowell_fix(k, r, v, tofs, rtol=1e-11, *, events=None, f=func_twobody):
x, y, z = r
vx, vy, vz = v
u0 = np.array([x, y, z, vx, vy, vz])
---- class overide below to test cowell_fix. --------
class CowellPropagator(PoliastroCowellPropagator):
def propagate(self, state, tof):
state = state.to_vectors()
tofs = tof.reshape(-1)
Results using the cowell_fix function below using same initial conditions:
delta times from y0=
[-300. -266.66666667 -233.33333333 -200. -166.66666667
-133.33333333 -100. -66.66666667 -33.33333333 0.
33.33333333 66.66666667 100. 133.33333333 166.66666667
200. 233.33333333 266.66666667 300. ] min
e2bSat.method=<correlator.geometry.twobody.CowellPropagator object at 0x13f7b2a40>
prop_diff_mag7=[2.01869067e-04 2.05452515e-04 1.12784197e-04 1.12771817e-04
2.67043241e-04 2.50137702e-05 2.95860249e-05 1.18887560e-04
4.71719891e-06 1.09649999e-08 5.06505217e-06 1.61361249e-04
9.29197723e-05 1.62357351e-05 1.77809202e-04 6.37251612e-05
9.77718679e-05 1.32277469e-04 1.77257689e-04]
e2bSat.method=<poliastro.twobody.propagation.danby.DanbyPropagator object at 0x13f7b3f40>
prop_diff_mag7=[9.37889539e-06 8.21289650e-07 1.07759340e-08 3.14741652e-08
2.18417273e-07 8.89761971e-08 1.01371460e-09 3.24896772e-07
5.74349235e-06 1.41943984e-05 1.38654895e-05 6.18781225e-06
3.91653789e-07 2.26730137e-08 5.44771397e-08 2.06767962e-07
3.89456432e-08 1.40829733e-08 7.16486586e-07]
e2bSat.method=<poliastro.twobody.propagation.farnocchia.FarnocchiaPropagator object at 0x13f7b37f0>
prop_diff_mag7=[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
e2bSat.method=<poliastro.twobody.propagation.gooding.GoodingPropagator object at 0x13f7b3700>
prop_diff_mag7=[0.00000000e+00 4.17965238e-09 5.06857301e-10 5.73443576e-09
5.73443576e-09 1.64709127e-08 4.17965238e-09 4.09426515e-09
1.19084502e-08 4.53346952e-09 2.23017213e-08 2.02742921e-09
9.12343142e-09 2.28704439e-08 1.72033073e-08 2.02742921e-09
2.86721788e-09 8.66118136e-09 3.35993732e-08]
e2bSat.method=<poliastro.twobody.propagation.markley.MarkleyPropagator object at 0x13f7b2d10>
prop_diff_mag7=[9.06693904e-09 0.00000000e+00 0.00000000e+00 9.06693904e-09
0.00000000e+00 2.58049609e-08 1.01371460e-09 4.05485841e-09
0.00000000e+00 2.02742921e-09 2.86721788e-09 5.73443576e-09
1.01371460e-09 4.56171571e-09 9.29084780e-09 0.00000000e+00
4.05485841e-09 1.01371460e-09 4.68507262e-08]
e2bSat.method=<poliastro.twobody.propagation.mikkola.MikkolaPropagator object at 0x13f7b24a0>
prop_diff_mag7=[9.06693904e-09 4.17965238e-09 0.00000000e+00 0.00000000e+00
7.30999996e-09 1.64709127e-08 4.17965238e-09 4.07066689e-09
1.49673167e-08 4.17965238e-09 3.73289305e-08 2.86721788e-09
9.34598685e-09 2.26730137e-08 8.10971682e-09 0.00000000e+00
2.02742921e-09 8.66118136e-09 3.35993732e-08]
e2bSat.method=<poliastro.twobody.propagation.pimienta.PimientaPropagator object at 0x13f7b2260>
prop_diff_mag7=[0.00000000e+00 4.17965238e-09 5.06857301e-10 5.73443576e-09
5.73443576e-09 1.64709127e-08 4.17965238e-09 4.07066689e-09
1.49673167e-08 4.05485841e-09 3.54655265e-08 2.86721788e-09
4.60208566e-08 1.76459150e-07 3.42773469e-07 4.83617304e-08
4.88236146e-06 2.79447798e-05 1.08598437e-04]
e2bSat.method=<poliastro.twobody.propagation.recseries.RecseriesPropagator object at 0x13f7b0c40>
prop_diff_mag7=[0.00500154 0.14758535 0.02721475 0.29855354 0.04438455 0.14259895
0.01727641 0.11050271 0.33731653 0.64837285 0.01131748 0.83810392
0.55781191 0.22144075 0.03032468 0.04470962 0.04386429 0.26307067
0.61246696]
e2bSat.method=<poliastro.twobody.propagation.vallado.ValladoPropagator object at 0x13f7b1930>
prop_diff_mag7=[4.53346952e-09 6.08228762e-09 4.60348104e-08 1.15278562e-07
1.51569826e-07 8.23296039e-08 1.58347283e-08 1.02773442e-08
1.14800661e-08 1.16466941e-08 2.66666677e-08 1.09180404e-08
1.60362473e-08 1.57325926e-07 3.86734446e-07 5.85702507e-07
4.94991765e-07 2.40111309e-07 2.25223797e-08]
The text was updated successfully, but these errors were encountered: