Page 1 of 1

Generate SSC parameters from positions

Posted: 08.01.2009, 21:25
by Pirmin
Hello

I have two positions with their appropriate date/time.
- Position1 is on Earth orbit at time1.
- Position2 is on Mars orbit at time2.
BTW, position and time are Hohmann orbit leave and arrive position/time, but this shouldn't matter.
I want to calculate an elliptical orbit for a spacecraft, which passes the given positions (Apocenter and Pericenter) at the given times.
My trials to calculate the parameters resulted in visible mismatches for the orbits.
I'm looking for a lua script, a spreadsheet or the just formulas to calculate ALL the necessary EllipticalOrbit parameters for the spacecraft.ssc.

Pirmin

Re: Generate SSC parameters from positions

Posted: 08.01.2009, 22:31
by selden
Pirmin,

You might try JAQAR's SwingBy orbit calculator. Some comments about using it with Celestia are at
viewtopic.php?f=6&t=12317&p=110413#p110413

Re: Generate SSC parameters from positions

Posted: 09.01.2009, 07:10
by Pirmin
Selden,

Thank you for your response.
JAQAR's SwingBy generates xyzv trajectories for interplanetary flight.
I would prefer just EllipticalOrbit parameters which are more handy to use.
I would like to understand how I can calculate orbit parameters for any pair of positions (Apocenter and Pericenter) around the sun (or any star).

Consider the following.
There is a star a some location and you know two positions where a planet (or any object with no thrust) passes.
There can be only one elliptical orbit which adheres these constraints.
I would like to calculate the necessary EllipticalOrbit parameters using a celx script (Lua) to solve this problem.

JAQAR's SwingBy xyzv trajectories may be good for a specific problem.
But what I want is a generel rule (or formulas) which I can use to solve any similar problem in Celestia, without transfering data to and from an external application.

Pirmin

Re: Generate SSC parameters from positions

Posted: 09.01.2009, 16:16
by selden
My (possibly flawed) understanding is that accurate Hohmann transfers cannot be represented by a single simple Keplerian orbit as described by Celestia's EllipticalOrbit declaration. The planetary orbits are in different planes, so a plane change is required as part of the transfer. For example, If the pericenter of a simple ellipse is in the plane of the origin planet (e.g. Earth), its apocenter usually will be quite far away from the plane of the orbit of the destination planet (e.g. Mars).

That said, you might want to take a look at the Java Astrodynamics Toolkit (JAT) at
http://jat.sourceforge.net/

Re: Generate SSC parameters from positions

Posted: 11.01.2009, 03:35
by jdavies
Wow! Thanks for that link Selden. My mind is in overdrive thinking of all the evil uses I can put that to! Very cool stuff.

- Jeff

Re: Generate SSC parameters from positions

Posted: 12.01.2009, 05:54
by Pirmin
Thanks for your explanation. You're right, I missed out the point with the different planes.
So, what I wanted can not work as intended.
Also thanks for the link!
Pirmin