hannorein / rebound

💫 An open-source multi-purpose N-body code.
https://rebound.readthedocs.io/
GNU General Public License v3.0
817 stars 216 forks source link

There are quite significant differences in the orbital elements of asteroids and their clones #769

Closed ghost closed 2 months ago

ghost commented 2 months ago

I am making an N-body simulation for an asteroid (https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2022%20NX1) and creating a clone orbit from the orbital element values ​​and their uncertainties (sourced from the Small-Body Database Lookup). I set a specific time in the simulation, namely the epoch time of the orbit element in SBDB-Lookup. but why are the orbital elements of the main asteroid different from the orbital elements of its clones?

The following are the main orbital elements: <rebound.Orbit instance, a=1.0075303706793062 e=0.0322903510312345 inc=0.018933934093774984 Omega=-1.5011864198922007 omega=3.217858429092081 f=4.16624367 9838836>

and this is an example of a clone orbit element:

<rebound.Orbit instance, a=1.0232167042494333 e=0.024483633176898518 inc=0.0186065488574797 Omega=-1.4925701538747884 omega=2.991788677955004 f=4.38874550 7118372>,

<rebound.Orbit instance, a=1.023216645685656 e=0.024483670224716463 inc=0.01860658068387822 Omega=-1.4925661208152603 omega=2.991783751028704 f=4.38874060 6041783>,

slightly significant differences in semimajor axis orbital elements, inclinations and others (should differ within decimal order e-8).

PS : I added the main asteroid (including the sun, moon and planets) with Horizon System.

dtamayo commented 2 months ago

Are you adding the clones using Horizons too? What’s the code you’re using just to make the clones?

hannorein commented 2 months ago

It would have been helpful to see some code of yours. But here's what's probably going on. REBOUND uses Jacobi coordinates by default. The order of particles matters. You are adding your clones at a different place than the originals, so their Jacobi coordinates are different. See this tutorial for more details on orbital elements: https://rebound.readthedocs.io/en/latest/ipython_examples/OrbitalElements/

ghost commented 2 months ago

Are you adding the clones using Horizons too? What’s the code you’re using just to make the clones?

No Sir, I created a list of clone orbit elements using numpy random normal from the uncertainty values ​​of the main asteroid orbit elements. Then I saved the data in a CSV extension file. Next I added a clone object based on the orbit element.

`#large bodies sim.add("Sun", date = initdate) sim.add("Mercury", date = initdate) sim.add("Venus", date = initdate) sim.add("399", date = initdate) sim.add("301", date = initdate) sim.add("Mars", date = initdate) sim.add("Jupiter", date = initdate) sim.add("Saturn", date = initdate) sim.add("Uranus", date = initdate) sim.add("Neptune", date = initdate)

objek

objek = "2022 NX1" sim.add(objek, date = initdate)`

Clone Orbit

for a,e,inc,Om,om,f in zip (data['a'], data['e'], data['inc'], data['Omega'], data['omega'], data['f']): sim.add(a = a, e = e, inc = inc, Omega=Om, omega=om, f=f, date = initdate)

dtamayo commented 2 months ago

It looks like all your orbital elements are coming from ‘data’ so I would look there

ghost commented 2 months ago

It looks like all your orbital elements are coming from ‘data’ so I would look there

This is an example of clone orbit element data :

clonedata

dtamayo commented 2 months ago

Looks like @hannorein is right as usual then :) you need to figure out what type of coordinates your table is in (heliocentric, Jacobi?) and be consistent with the original asteroid and the clones

ghost commented 2 months ago

Looks like @hannorein is right as usual then :) you need to figure out what type of coordinates your table is in (heliocentric, Jacobi?) and be consistent with the original asteroid and the clones

I think that the orbit elements above are in heliocentric coordinates.

dtamayo commented 2 months ago

All your clones are consistent, it’s the asteroid that’s messed up, so look at the coordinates used in horizons.ipynb and mess with that until it matches the clones. Alternatively, if you don’t want to figure out the coordinates, and it works for your use case, you could take all your clone particles, take the distribution of the spreads in their x y z vx vy vz, and add clones by sampling particles[asteroid].x + sampleDeltax etc

ghost commented 2 months ago

All your clones are consistent, it’s the asteroid that’s messed up, so look at the coordinates used in horizons.ipynb and mess with that until it matches the clones. Alternatively, if you don’t want to figure out the coordinates, and it works for your use case, you could take all your clone particles, take the distribution of the spreads in their x y z vx vy vz, and add clones by sampling particles[asteroid].x + sampleDeltax etc

OK, thank you sir I will try my best