Welcome, Guest. Please Login.
Gravity Simulator
11/24/17 at 03:16:30
News: Registration for new users has been disabled to discourage spam. If you would like to join the forum please send me an email with your desired screen name to tony at gravitysimulator dot com.
Home Help Search Login


Pages: 1
Send Topic Print
Trajectory Control Sim (Read 4062 times)
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Trajectory Control Sim
12/28/12 at 13:45:45
 
Just out of curiousity I wrote this little Trajectory control Simulation .  
Playing with it may give a few hours of frustration , but may learn something about manoevering a spacecraft .  
 
The sim goes as follows:  
An spacecraft  is orbiting our Sun at a distance of 1 AU . No other planets . It keeps going around the sun in a perfect circle.  
The  crew onboard however can adjust thier course by giving thrust using their keyboard .  
 
Arrow up : increases their speed  
Arrow down : decreases their speed .  
Arrow right : thrust awy from the center  
Arrow left : thrust towards the center .  
 
Each keyboard hit gives the spaccraft a dv of 50 m/s.  
 
The sim starts with an eccentricity of 0 and a Sma of 1 Au .  
It can be rather complicated to return to a circular orbit at 1AU once a thrust is given for a few seconds .  Please try .  
 
To get  an executable please give the document the extension .EXE instead of .TXT
The sim stops pressing any key except the keys mentionned above .  
 
Edit ; the green line represents the side view of the orbit . Manoeuvering in the z-plane is not yet possible in this early version .  
The code was written with a Verlet integrator having a timestep of 1/2 day .  
 
 
 
 
 
Back to top
« Last Edit: 12/28/12 at 15:16:53 by frankuitaalst »  
Email View Profile   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: Trajectory Control Sim
Reply #1 - 12/28/12 at 20:05:56
 
Hi Frank,
 
The program doesn't close properly.  When I hit the red X, the window disappears, but Task Manager tells me it is still running.  Re-opening the program now causes 2 instances of the program to run.  I have to shut them down with task manager.
 
You can do the same thing in Gravity Simulator with the Thrust Box in the View menu.  It's actually very easy to return to a circular orbit if your time step is slow.  Open a Orbit Elements Box, also in the view menu.  Tap Prograde 10 m/s.  If Ecc goes up, then tap Retrograde and keep pressing until Ecc minimizes, then switch to 1 m/s.  When Ecc is minimized again, switch to Towards and Away and do the same thing.
 
It's interesting to note that you can not cause an orbit to spiral inward or outward with a small but continuous thrust towards or away from the Sun.
Back to top
 
 
Email View Profile WWW   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: Trajectory Control Sim
Reply #2 - 12/29/12 at 02:08:16
 
Thanks for the reply Tony .  
The close window button is not active . To stop the program hit any key. This should do it . I'm aware pressing the X icon is a better way .  
I know the boost option is a feature in GravSim . This works great and has better functionality . What I was missing is a thrust perpendicular to the plane of orbit , that's the reason I started this program . This feature is not yet coded in my code . It should allow to change the orbital inclination  . Or does GravSim instead do this feature ?  
You're right : applying a continious radial boost does not give a spiraling out of the craft , but rather changes the eccentricity . This is somehow counter intuitive .  
I guess applying a boost perpendicular to the plane of orbit in order to change inclination may also give some unexpected results .
Back to top
 
 
Email View Profile   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: Trajectory Control Sim
Reply #3 - 12/29/12 at 11:49:36
 
You can do this in Gravity Simulator if you're willing to do the math.  The "custom" option on the Thrust Control allows you to point your spacecraft towards a specified altitude and azimuth.
Back to top
 
 
Email View Profile WWW   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: Trajectory Control Sim
Reply #4 - 12/30/12 at 01:36:10
 
Here's an updated version of the Trajectory Control Sim .  
It allows to get out of the orbital plane by pressing "Page Up" or "Page down" .  
Pushing this buttons gives a thrust perpendicular to the plane of orbit .  
It thus allows to change the  inclination .  
 
Playing with it gives the unexpected result that if one applies a continious upward thrust this doesn't give a steady increase in inclination .  
A nearly  steady gain of inclination is given if the thrust is only given every  half orbit .  
Applying a continious upward thrust however results in the spacecraft to hoover over the ecliptic at a certain ( but varying ) height. However doing this requires a lot of fuel.  
 
PS : Change .txt to .exe in the filename in order to get an executable  
Press any other key to stop the program ( don't hit the X "close button" )
Back to top
« Last Edit: 12/30/12 at 07:26:00 by frankuitaalst »  
Email View Profile   IP Logged
atomic7732
Full Member
***


Kalassak, Paladin of
Storms

Posts: 149
Gender: male
Re: Trajectory Control Sim
Reply #5 - 04/05/13 at 19:05:25
 
It's says the file isn't compatible with my version of Windows...
 
I have 64-bit.
Back to top
 
 
Email View Profile   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: Trajectory Control Sim
Reply #6 - 04/06/13 at 01:47:32
 
That's funny . I have 64-bit too , works without problem .  
When do you get the message ? Can you add a small screenshot of what you get ?
Back to top
 
 
Email View Profile   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: Trajectory Control Sim : exercuse
Reply #7 - 11/05/13 at 09:57:07
 
Exercise :  
In the "Baut" forum there is a theme about manoeuvering in space .  
The Original question is how to approach a spacecraft which is 10° ahead of your spacecraft .  
 
Both spacecrafts are initially in  a circular orbit .  
The sim in annex lets you take control of the spacecraft behind the spacecraft in front which orbits the sun at 1AU .  
 
How to approach succesfully ?  
a. Aim to the spacecraft in front and fire your rockets ?
b. Give backward thrust away from  the spacecraft ?  
c. Manoeuver giving radial thrust in and/or outward ?  
d. Some strategy as a mix of the possibilities above ?  
The sim in annex lets you find out .  
You have 4 different rockets : towards the target , away from the target , inward to sun , outward from sun .  
Each burn gives a delta v of 100 m/s .  
 
To play download the file , change to extensio from ".txt" to ".exe" and run .  
Hitting any key other then the four arrows stops the programm .  
If you simply want to reset press "r" .  
 
Playing with it is quite confrontating . It shows how extremely difficult it is to navigate in space , even if one has a full vieuw on its position .  
 Smiley
Edit : forgot to mention : the path showing up in the middele of the screen shows the position of our vessel relative to the target , magnified by a factor of 2 .
Back to top
« Last Edit: 11/05/13 at 12:56:42 by frankuitaalst »  
Email View Profile   IP Logged
Pages: 1
Send Topic Print