Generate SSC parameters from positions

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Pirmin
Posts: 3
Joined: 08.01.2009
With us: 15 years 11 months
Location: Switzerland

Generate SSC parameters from positions

Post #1by Pirmin » 08.01.2009, 21:25

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

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Generate SSC parameters from positions

Post #2by selden » 08.01.2009, 22:31

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
Selden

Topic author
Pirmin
Posts: 3
Joined: 08.01.2009
With us: 15 years 11 months
Location: Switzerland

Re: Generate SSC parameters from positions

Post #3by Pirmin » 09.01.2009, 07:10

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

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Generate SSC parameters from positions

Post #4by selden » 09.01.2009, 16:16

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/
Selden

jdavies
Posts: 65
Joined: 05.12.2008
With us: 16 years

Re: Generate SSC parameters from positions

Post #5by jdavies » 11.01.2009, 03:35

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

Topic author
Pirmin
Posts: 3
Joined: 08.01.2009
With us: 15 years 11 months
Location: Switzerland

Re: Generate SSC parameters from positions

Post #6by Pirmin » 12.01.2009, 05:54

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


Return to “Scripting”