delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/16/23:30:43

From: Jason Dagit <thedagit AT mail DOT coos DOT or DOT us>
Newsgroups: gac.physics.astronomy,nctu.club.astronomy,relcom.fido.su.astronomy,sl AT psycode DOT com,comp.os.msdos.djgpp
Subject: Re: Orbits, planets, PLEASE HELP!
Date: Mon, 16 Mar 1998 20:20:40 -0800
Organization: Dagit Enterprises
Lines: 64
Message-ID: <350DFA18.DF98FAE5@mail.coos.or.us>
References: <bWLoegW7sFse-pn2-nOBQTFs4XI88 AT portA01 DOT Generation DOT NET>
Reply-To: thedagit AT mail DOT coos DOT or DOT us
NNTP-Posting-Host: coosbay1-99.transport.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello,

Here is how I would tackle this dilema:

Perhaps I'm just ignorant (I'm 18 and still in HS) but wouldn't it be
possible to find the paths of the celestial objects simply by applying
the forces of gravity in 3 dimensions?  I mean, you can find out the
masses, you know the formula for gravity (or at least it should be easy
to find) and if you can find the velocities and distances you're set. 
Of course this would be a very slow and time consuming process to
calculate the gravity equation for all the celestial objects every
second.  One optimization would be to consider the ratio of masses and
what the force of gravity was before the distance changed then use that
to find the new force of gravity given a change in distance.  Also, I
think to get the right answers you would need to keep all the original
information until you have processed all the celestial objects, then
write over that old data with the new.  Perhaps you could store all the
changes in force in a transition matrix and then use that.  I'm not sure
about the best/fastest implementation.

One forseeable (is that a word?!?) problem is that your data types won't
give enough precision.  Arbitrary math libs are out there, but they are
slower than intrinsic data types.

Before anyone calls me dumb for doing it this way, let me say, I've only
had one year of physics and no one else has suggested a way in this ng.

Hope this message was in time to help,
Jason
PS I have a CDrom with a planetarium on it, and they must have equations
for celestial pathes because they can instanly just to any year and know
the planetary positions.

Ah, that gives me another idea, use parametric equations, but I have no
clue how to implement that.

Gili wrote:
> 
> Hello,
> 
>         I have a science project due next week. I am programming something
> which will find the most efficient orbit given certain parameters.
> However, I have been unable to find the locations of all planets (and
> their moons) in our solar system at a fixed time. In order for my
> program to work, I must have the positions of all planets (and their
> moons) at a fixed time (so I know where they all begin off) and I also
> need to know their exact velocity at that given time.
> 
>         My program will launch a rocket into space where it will be totally
> under the influence of gravity (which is why I need to know the
> positions/velocities of those planets.) However, I have run into
> another problem, how do I know the positions of the planets in the
> solar system after 1 second has past? The same goes for my rocket..
> 
>         I can resolve the force vectors being applied by all the
> planets/moons on my rocket, and I know its position and velocity. But
> where do I go from there? How do I know where it will be a second
> later?
> 
>         Please help me as soon as possible. Thank you,
> 
> PS: Please email your response to "sl AT psycode DOT com"
> 
> Gili

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019