From: Bill Currie Newsgroups: gac.physics.astronomy,nctu.club.astronomy,relcom.fido.su.astronomy,tw.bbs.sci.astronomy,comp.os.msdos.djgpp Subject: Re: Orbits, planets, PLEASE HELP! Date: Tue, 17 Mar 1998 09:18:11 +1200 Organization: Telecommunication Systems Support Centre Lines: 66 Message-ID: <350D9713.39B4@tssc.co.nz> References: NNTP-Posting-Host: node106.tssc.co.nz Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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. I can't help you there, other than sugest asking NASA (poke around http://www.nasa.gov/ for some contact addresses). > 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.. Does it realy have to be our solar system? It seems that your project is to demonstrate transfer orbits and sling-shots. Why not just make up a solar system (that makes sense) and use that. > 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? Ouch, you're getting into numerical integration techniques here. I would suggest looking up runge-kutta (altavista gives some good links and I imagine yahoo will as well). However, I can give you some tips to get started. r is a vector GM a= - -- * r 3 |r| giving a as the accelleration vector. nx (new x) and nv can be found with (t is actually change in time) nx = x + v*t + a * t * t / 2 + b * t * t * t / 6 nv = v + a * t + b * t * t / 3 b can be fount by calculating nx for a very small t (dt) and recalculating the acceleration (na) b = (na - a) / dt The above isn't Runge-Kutta (RK is much better AFAIK) and it has some problems, but it does work so long as things don't get to close for your t. Also, you might want to poke around http://www.astro.virginia.edu/~eww6n/author.html It has some exelent math and physics papers. HTH Bill -- Leave others their otherness