Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

cowell propagator issue when tofs include both positive and negative delta times relative to y0 epoch. #1630

Open
jhouchard opened this issue May 29, 2023 · 0 comments

Comments

@jhouchard
Copy link

馃悶 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:
conda info -a

     active environment : astro
    active env location : /Users/jhouchard/miniconda3/envs/astro
            shell level : 2
       user config file : /Users/jhouchard/.condarc
 populated config files : 
          conda version : 23.3.0
    conda-build version : not installed
         python version : 3.10.8.final.0
       virtual packages : __archspec=1=arm64
                          __osx=13.3.1=0
                          __unix=0=0
       base environment : /Users/jhouchard/miniconda3  (writable)
      conda av data dir : /Users/jhouchard/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/jhouchard/miniconda3/pkgs
                          /Users/jhouchard/.conda/pkgs
       envs directories : /Users/jhouchard/miniconda3/envs
                          /Users/jhouchard/.conda/envs
               platform : osx-arm64
             user-agent : conda/23.3.0 requests/2.28.1 CPython/3.10.8 Darwin/22.4.0 OSX/13.3.1
                UID:GID : 503:20
             netrc file : None
           offline mode : False

# conda environments:
#
base                     /Users/jhouchard/miniconda3
astro                 *  /Users/jhouchard/miniconda3/envs/astro

sys.version: 3.10.8 (main, Nov 24 2022, 08:08:27) [Cl...
sys.prefix: /Users/jhouchard/miniconda3
sys.executable: /Users/jhouchard/miniconda3/bin/python
conda location: /Users/jhouchard/miniconda3/lib/python3.10/site-packages/conda
conda-build: None
conda-content-trust: /Users/jhouchard/miniconda3/bin/conda-content-trust
conda-env: /Users/jhouchard/miniconda3/bin/conda-env
user site dirs: 

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: astro
CONDA_EXE: /Users/jhouchard/miniconda3/bin/conda
CONDA_PREFIX: /Users/jhouchard/miniconda3/envs/astro
CONDA_PREFIX_1: /Users/jhouchard/miniconda3
CONDA_PROMPT_MODIFIER: (astro) 
CONDA_PYTHON_EXE: /Users/jhouchard/miniconda3/bin/python
CONDA_ROOT: /Users/jhouchard/miniconda3
CONDA_SHLVL: 2
CURL_CA_BUNDLE: <not set>
LD_PRELOAD: <not set>
PATH: /opt/local/bin:/opt/local/sbin:/Users/jhouchard/miniconda3/envs/astro/bin:/Users/jhouchard/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
REQUESTS_CA_BUNDLE: <not set>
SSL_CERT_FILE: <not set>

conda list
# packages in environment at /Users/jhouchard/miniconda3/envs/astro:
#
# Name                    Version                   Build  Channel
anyio                     3.5.0           py310hca03da5_0  
appnope                   0.1.2           py310hca03da5_1001  
argon2-cffi               21.3.0             pyhd3eb1b0_0  
argon2-cffi-bindings      21.2.0          py310h1a28f6b_0  
astropy                   5.2.2                    pypi_0    pypi
astroquery                0.4.6              pyhd8ed1ab_0    conda-forge
asttokens                 2.0.5              pyhd3eb1b0_0  
attrs                     22.1.0          py310hca03da5_0  
babel                     2.11.0          py310hca03da5_0  
backcall                  0.2.0              pyhd3eb1b0_0  
beautifulsoup4            4.11.1          py310hca03da5_0  
black                     23.3.0                   pypi_0    pypi
blas                      1.0                    openblas  
bleach                    4.1.0              pyhd3eb1b0_0  
brotli                    1.0.9                h1a28f6b_7  
brotli-bin                1.0.9                h1a28f6b_7  
brotlipy                  0.7.0           py310h1a28f6b_1002  
bzip2                     1.0.8                h620ffc9_4  
c-ares                    1.18.1               h1a28f6b_0  
ca-certificates           2022.12.7            h4653dfc_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cairo                     1.16.0               h302bd0f_3  
certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py310h80987f9_3  
cftime                    1.5.1.1         py310h96f19d2_0  
charset-normalizer        2.0.4              pyhd3eb1b0_0  
click                     8.1.3                    pypi_0    pypi
comm                      0.1.2           py310hca03da5_0  
contourpy                 1.0.5           py310h525c30c_0  
correlator                0.1.0                    pypi_0    pypi
coverage                  7.2.3                    pypi_0    pypi
cryptography              39.0.1          py310h834c97f_0  
curl                      7.87.0               h80987f9_0  
cycler                    0.11.0             pyhd3eb1b0_0  
czml3                     0.7.0              pyhd8ed1ab_0    conda-forge
debugpy                   1.5.1           py310hc377ac9_0  
decorator                 5.1.1              pyhd3eb1b0_0  
defusedxml                0.7.1              pyhd3eb1b0_0  
eigen                     3.3.7                h525c30c_1  
entrypoints               0.4             py310hca03da5_0  
exceptiongroup            1.1.1                    pypi_0    pypi
executing                 0.8.3              pyhd3eb1b0_0  
expat                     2.4.9                hc377ac9_0  
ffmpeg                    4.2.2                h04105a8_0  
flit-core                 3.6.0              pyhd3eb1b0_0  
fontconfig                2.14.1               h6b8db82_1  
fonttools                 4.25.0             pyhd3eb1b0_0  
freetype                  2.12.1               h1192e45_0  
gettext                   0.21.0               h826f4ad_0  
giflib                    5.2.1                h80987f9_3  
glib                      2.69.1               h514c7bf_2  
gmp                       6.2.1                hc377ac9_3  
gnutls                    3.6.15               h887c41c_0  
graphite2                 1.3.14               hc377ac9_1  
gst-plugins-base          1.14.1               h313beb8_1  
gstreamer                 1.14.1               h80987f9_1  
harfbuzz                  4.3.0                hb1b0ec1_0  
hdf4                      4.2.13               h5e329fb_3  
hdf5                      1.12.1               h160e8cb_2  
html5lib                  1.1                pyh9f0ad1d_0    conda-forge
icu                       68.1                 hc377ac9_0  
idna                      3.4             py310hca03da5_0  
imageio                   2.29.0                   pypi_0    pypi
importlib-metadata        6.1.0              pyha770c72_0    conda-forge
importlib_metadata        6.1.0                hd8ed1ab_0    conda-forge
importnb                  2023.1.7           pyhd8ed1ab_0    conda-forge
iniconfig                 2.0.0                    pypi_0    pypi
ipykernel                 6.19.2          py310h33ce5c2_0  
ipython                   8.10.0          py310hca03da5_0  
ipython_genutils          0.2.0              pyhd3eb1b0_1  
jaraco.classes            3.2.3              pyhd8ed1ab_0    conda-forge
jedi                      0.18.1          py310hca03da5_1  
jinja2                    3.1.2           py310hca03da5_0  
jpeg                      9e                   h80987f9_1  
jplephem                  2.18               pyh78acc04_0    conda-forge
json5                     0.9.6              pyhd3eb1b0_0  
jsonschema                4.17.3          py310hca03da5_0  
jupyter_client            7.4.9           py310hca03da5_0  
jupyter_core              5.2.0           py310hca03da5_0  
jupyter_server            1.23.4          py310hca03da5_0  
jupyterlab                3.5.3           py310hca03da5_0  
jupyterlab_pygments       0.1.2                      py_0  
jupyterlab_server         2.19.0          py310hca03da5_0  
keyring                   23.13.1         py310hca03da5_0  
kiwisolver                1.4.4           py310h313beb8_0  
krb5                      1.19.4               h8380606_0  
lame                      3.100                h1a28f6b_0  
lcms2                     2.12                 hba8e193_0  
lerc                      3.0                  hc377ac9_0  
libbrotlicommon           1.0.9                h1a28f6b_7  
libbrotlidec              1.0.9                h1a28f6b_7  
libbrotlienc              1.0.9                h1a28f6b_7  
libclang                  12.0.0          default_hc321e17_4  
libcurl                   7.87.0               h0f1d93c_0  
libcxx                    14.0.6               h848a8c0_0  
libdeflate                1.17                 h80987f9_0  
libedit                   3.1.20221030         h80987f9_0  
libev                     4.33                 h1a28f6b_1  
libffi                    3.4.2                hca03da5_6  
libgfortran               5.0.0           11_3_0_hca03da5_28  
libgfortran5              11.3.0              h009349e_28  
libiconv                  1.16                 h1a28f6b_2  
libidn2                   2.3.1                h1a28f6b_0  
libllvm11                 11.1.0               h93073aa_2    conda-forge
libllvm12                 12.0.0               h12f7ac0_4  
libnetcdf                 4.8.1                h1b8e529_2  
libnghttp2                1.46.0               h95c9599_0  
libopenblas               0.3.21               h269037a_0  
libopus                   1.3                  h1a28f6b_1  
libpng                    1.6.39               h80987f9_0  
libpq                     12.9                 h65cfe13_3  
libsodium                 1.0.18               h1a28f6b_0  
libssh2                   1.10.0               hf27765b_0  
libtasn1                  4.16.0               h1a28f6b_0  
libtiff                   4.5.0                h313beb8_2  
libunistring              0.9.10               h1a28f6b_0  
libvpx                    1.10.0               hc377ac9_0  
libwebp                   1.2.4                ha3663a8_1  
libwebp-base              1.2.4                h80987f9_1  
libxml2                   2.9.14               h8c5e841_0  
libxslt                   1.1.35               h9833966_0  
libzip                    1.8.0                h0c481fb_0  
llvm-openmp               14.0.6               hc6e5704_0  
llvmlite                  0.39.1          py310h98b2900_0  
loguru                    0.7.0                    pypi_0    pypi
lxml                      4.9.1           py310h2fae87d_0  
lz4-c                     1.9.4                h313beb8_0  
markupsafe                2.1.1           py310h1a28f6b_0  
matplotlib                3.7.0           py310hca03da5_0  
matplotlib-base           3.7.0           py310h46d7db6_0  
matplotlib-inline         0.1.6           py310hca03da5_0  
mistune                   0.8.4           py310h1a28f6b_1000  
more-itertools            9.1.0              pyhd8ed1ab_0    conda-forge
munkres                   1.1.4                      py_0  
mypy-extensions           1.0.0                    pypi_0    pypi
nbclassic                 0.5.2           py310hca03da5_0  
nbclient                  0.5.13          py310hca03da5_0  
nbconvert                 6.5.4           py310hca03da5_0  
nbformat                  5.7.0           py310hca03da5_0  
ncurses                   6.4                  h313beb8_0  
nest-asyncio              1.5.6           py310hca03da5_0  
netcdf4                   1.6.2           py310he1bbb67_0  
nettle                    3.7.3                h84b5d62_1  
notebook                  6.5.2           py310hca03da5_0  
notebook-shim             0.2.2           py310hca03da5_0  
nspr                      4.33                 hc377ac9_0  
nss                       3.74                 h142855e_0  
numba                     0.56.4          py310h46d7db6_0  
numpy                     1.23.5          py310hb93e574_0  
numpy-base                1.23.5          py310haf87e8b_0  
opencv                    4.6.0           py310h46d7db6_3  
openh264                  1.8.0                h98b2900_0  
openssl                   1.1.1t               h03a7124_0    conda-forge
packaging                 22.0            py310hca03da5_0  
pandas                    2.0.1                    pypi_0    pypi
pandocfilters             1.5.0              pyhd3eb1b0_0  
parso                     0.8.3              pyhd3eb1b0_0  
pathspec                  0.11.1                   pypi_0    pypi
pcre                      8.45                 hc377ac9_0  
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pillow                    9.4.0           py310h313beb8_0  
pip                       22.3.1          py310hca03da5_0  
pixman                    0.40.0               h1a28f6b_0  
platformdirs              2.5.2           py310hca03da5_0  
plotly                    5.13.1             pyhd8ed1ab_0    conda-forge
pluggy                    1.0.0                    pypi_0    pypi
poliastro                 0.17.0             pyhd8ed1ab_1    conda-forge
pooch                     1.7.0              pyha770c72_3    conda-forge
prometheus_client         0.14.1          py310hca03da5_0  
prompt-toolkit            3.0.36          py310hca03da5_0  
psutil                    5.9.0           py310h1a28f6b_0  
ptyprocess                0.7.0              pyhd3eb1b0_2  
pure_eval                 0.2.2              pyhd3eb1b0_0  
pycparser                 2.21               pyhd3eb1b0_0  
pyerfa                    2.0.0           py310h1a28f6b_0  
pygments                  2.11.2             pyhd3eb1b0_0  
pymap3d                   3.0.1              pyhd8ed1ab_0    conda-forge
pyopenssl                 23.0.0          py310hca03da5_0  
pyparsing                 3.0.9           py310hca03da5_0  
pyrsistent                0.18.0          py310h1a28f6b_0  
pysocks                   1.7.1           py310hca03da5_0  
pytest                    7.3.1                    pypi_0    pypi
pytest-datadir            1.4.1                    pypi_0    pypi
python                    3.10.9               hc0d8a6c_1  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python-fastjsonschema     2.16.2          py310hca03da5_0  
pytz                      2022.7          py310hca03da5_0  
pyvo                      1.4.1              pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py310h80987f9_1  
pyzmq                     23.2.0          py310hc377ac9_0  
qt-main                   5.15.2               ha2d02b5_7  
qt-webengine              5.15.9               h2903aaf_4  
qtwebkit                  5.212                h0f11f3c_4  
readline                  8.2                  h1a28f6b_0  
requests                  2.28.1          py310hca03da5_0  
scipy                     1.10.0          py310h20cbe94_1  
send2trash                1.8.0              pyhd3eb1b0_1  
setuptools                65.6.3          py310hca03da5_0  
sgp4                      2.21                     pypi_0    pypi
six                       1.16.0             pyhd3eb1b0_1  
skyfield                  1.46                     pypi_0    pypi
sniffio                   1.2.0           py310hca03da5_1  
soupsieve                 2.3.2.post1     py310hca03da5_0  
sqlite                    3.40.1               h7a7dc30_0  
stack_data                0.2.0              pyhd3eb1b0_0  
tbb                       2021.8.0             hffc8910_0    conda-forge
tenacity                  8.2.2              pyhd8ed1ab_0    conda-forge
terminado                 0.17.1          py310hca03da5_0  
tinycss2                  1.2.1           py310hca03da5_0  
tk                        8.6.12               hb8d0fd4_0  
tomli                     2.0.1           py310hca03da5_0  
tornado                   6.2             py310h1a28f6b_0  
traitlets                 5.7.1           py310hca03da5_0  
typing-extensions         4.4.0           py310hca03da5_0  
typing_extensions         4.4.0           py310hca03da5_0  
tzdata                    2023.3                   pypi_0    pypi
urllib3                   1.26.14         py310hca03da5_0  
w3lib                     2.1.1              pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyhd3eb1b0_0  
webencodings              0.5.1           py310hca03da5_1  
websocket-client          0.58.0          py310hca03da5_4  
wheel                     0.38.4          py310hca03da5_0  
x264                      1!152.20180806       h1a28f6b_0  
xz                        5.2.10               h80987f9_1  
yaml                      0.2.5                h1a28f6b_0  
zeromq                    4.3.4                hc377ac9_0  
zipp                      3.15.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               h5a0b063_0  
zstd                      1.5.2                h8574219_0  
# 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

  • 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:

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]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant