Welcome, Guest. Please Login.
Gravity Simulator
11/20/17 at 16:51:03
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 2 
Send Topic Print
New Gravity Simulator (Read 13093 times)
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
New Gravity Simulator
09/27/14 at 20:56:28
 
It works on all computers because it works in your browser.  I can even run it on my cell phone.
It doesn't have nearly all the bells and whistles of the Windows version.  You can't even save your simulations (at least not yet!)
It also behaves quite differently on different computers.
 
This is a recreation of the solar system barycenter simulation:
http://orbitsimulator.com/gravitySimulatorCloud/ssBarycenter.html
 
This traces the pentagram of Venus caused by the near 13:8 resonance between Venus and Earth
http://orbitsimulator.com/gravitySimulatorCloud/venusPentagram.html
 
This shows all the Moons of Jupiter
http://orbitsimulator.com/gravitySimulatorCloud/joviansystem.html
 
This shows the motion of the Spitzer Space Telescope.  Scroll down for a rotating frame version.
http://orbitsimulator.com/gravitySimulatorCloud/spitzer.html  
 
Voyager 1 approaches Jupiter.  It makes very close flybys of Io, Ganymede and Callisto before heading off for Saturn.
http://orbitsimulator.com/gravitySimulatorCloud/voyager1JupiterApproach.html
 
Super-massive black hole at the center of the Milky Way
http://orbitsimulator.com/gravitySimulatorCloud/mwbh.html
 
This one is user-controlable!
Deflecting Apophis.  Apophis won't hit Earth in 2029, but it will make a very close approach.  During this approach, if it passes through a "keyhole", it will return to strike Earth in 2036.  Scientists are certain that it won't pass through this keyhole.  But "what if"?  
 
This simulation begins in 2014.  This simulation gives you 3 Apophises.  The one called Apophis is based on Apophis' actual trajectory.  But a mere 10 kilometers away sits a pair of 'keyhole Apophises'.  They will pass through the keyhole.  They will return to strike Earth in 2036.  The "Vectors" interface lets you control them.  Leave one of them alone to act as your experimental 'control'.  See how much delta V it takes to nudge the other one off course so it misses the 2029 keyhole.  Just edit the velocity, and it will take off on a new trajectory.
 
This simulation controls the time step for you.  It also pauses prior to Apophis' close approaches to Earth.  You can override the time step, but don't.  If you go faster than 2048, and 32 when Apophis is in Earth's vicinity, you will not get accurate results.  The simulations takes care of this for you.  It takes some time for this simulation to develop, so be patient.  The sim will automatically pause a few days before Apophis' close approaches, so you won't return to your computer to discover you've missed it.
http://orbitsimulator.com/gravitySimulatorCloud/apophis2014.html
 
Trojan planet
Adjust the mass of a planet and its trojan companion to see what mass ratios are stable.
http://orbitsimulator.com/gravitySimulatorCloud/trojanratio.html
 
Turn off Sun's gravity
In demonstrating Newton's Laws, it seems to be a common conceptual question:  What path would the planets follow if the Sun's gravity were somehow turned off? With the press of a button the students can find out.
http://orbitsimulator.com/gravitySimulatorCloud/turnOffSunGravity.html
 
A binary star system with planets
This is one of the original Gravity Simulator simulations.
http://orbitsimulator.com/gravitySimulatorCloud/casella.html
 
If the Moon orbited the Earth in a polar orbit, it would crash to the Earth in under a decade due to the Kozai Mechanism.
http://orbitsimulator.com/gravitySimulatorCloud/kozaiMoon.html
 
Earth captures an asteroid.  In 2006, Earth captured 2006 RH120,  It spent just over a year orbiting Earth before escaping back into interplanetary space.
http://orbitsimulator.com/gravitySimulatorCloud/capturedmoon.html
Back to top
 
« Last Edit: 11/10/14 at 19:05:44 by Tony »  
Email View Profile WWW   IP Logged
flap
Uploader



I Love YaBB 2!

Posts: 26
Gender: male
Re: New Gravity Simulator
Reply #1 - 09/30/14 at 05:33:16
 
Hello Tony.
Unfortunately, is does not work for me (I see some boxes on the left side of the screen. But no animation)
 
EDIT : It actually works. I had not realised that I had to press the > button hidden somewhere along the boxes.
I guess that it is very much WIP...
Back to top
 
 
View Profile   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: New Gravity Simulator
Reply #2 - 09/30/14 at 22:21:27
 
Same here , works when the ">" button is pressed under "time step" .  
Wonder how Tony did this !
Back to top
 
 
Email View Profile   IP Logged
flap
Uploader



I Love YaBB 2!

Posts: 26
Gender: male
Re: New Gravity Simulator
Reply #3 - 10/01/14 at 07:26:44
 
html5 probably.
 
One issue now is that once a windows has been closed, it can't be reopened. (Or I haven't figured it out yet...).
 
Also, as you are porting orbitsim to another support, a cool feature would be to save the trajectory (instead of just drawing them), so we can keep them when zooming, changing the orientation...
Back to top
 
 
View Profile   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: New Gravity Simulator
Reply #4 - 10/01/14 at 11:05:51
 
Yes, this is HTML5 with javascript.
I probably should have began this sim unpaused.
 
I might try to save the trajectories, but there are a few other things higher on the priority list at the moment.
 
You can't save the sim as you figured out.  When you close it you lose it. Javascript doesn't allow you save files on a user's hard drive for security reasons.
There's 2 work-arounds:
1. Save the simulation to a text box.  The user copies the contents, pastes it into a text editor and saves it as a text file with an html extension.
2. Use PHP or Perl to save a user's simulation to my server.  This would require users have an account ($$) with me as server space is not free.
 
I made this because I work in a school where all the students have iPads.  I wanted to give them some assignments using Gravity Simulator that would work on their iPads.  It's worked fine for that purpose.  It's simple.  There's nothing to install.  The HTML5 version might not ever be as powerful as the Windows version.  Browsers don't like being thrown into what they perceive as an endless loop.  Any attempts I've made to speed it up result in a "script not responding" error.
 
So for the moment, this is just an attempt to recreate some of Gravity Simulator's simulations on a platform anyone can access.  I'll post a few more in the coming days.
Back to top
 
 
Email View Profile WWW   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: New Gravity Simulator
Reply #5 - 10/02/14 at 13:18:54
 
I'm not familiar with HTML programming , well , not very familiar , but I wonder how this works .  
Do you link then to an application which is running at your server , or is the executable code transferred to a Java engine on the users screen , or even worse did you have to reprogram GravSim into ...??
Back to top
 
 
Email View Profile   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: New Gravity Simulator
Reply #6 - 10/02/14 at 17:58:37
 
Quote from frankuitaalst on 10/02/14 at 13:18:54:
...or even worse did you have to reprogram GravSim into ...??

Yes, I had to reprogram.
But keep in mind, the RK-4 routine that powers Gravity Simulator is already coded in C++, which is virtually identical in syntax to javascript (at least for the stuff I'm doing).
And the orbital elements code was already translated into javascript code on my orbitsimulator.com/formulas page.
 
So it was more of a piecing together of stuff that already existed, and making slight modifications rather than coding from scratch.
 
The code is executed in your browser.  You can save it to your computer and run it offline.  Do a "view source" and you can see the code.
 
Here's another one: http://orbitsimulator.com/gravitySimulatorCloud/spitzer.html
This shows the Spitzer Space Telescope in a rotating frame.
Back to top
 
 
Email View Profile WWW   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: New Gravity Simulator
Reply #7 - 11/05/14 at 19:12:08
 
Venus pentagram and Jupiter's moons have been added to the first post of this thread.  I've also modified all simulations to begin in the play mode rather than the pause mode.
Back to top
 
 
Email View Profile WWW   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: New Gravity Simulator
Reply #8 - 11/07/14 at 09:02:00
 
I really like this work Tony ! especially the Jovian system .  
I guess we ( users ) cannot (yet ) select existing simulations and let them run on this app ?
Back to top
 
 
Email View Profile   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: New Gravity Simulator
Reply #9 - 11/07/14 at 18:04:33
 
Quote from frankuitaalst on 11/07/14 at 09:02:00:
I really like this work Tony ! especially the Jovian system .
I guess we ( users ) cannot (yet ) select existing simulations and let them run on this app ?

So far there are 4 you can select from!
I need to improve this a bit more, and add more features: labels, autopilot, etc.  Then I can port over any existing simulation.
 
I'm not sure it will ever be as good as the Windows version.  Simulating into the deep future seems a bit difficult.  Browsers don't like to be thrown into endless loops.  But for short simulations I like this.  It runs on ANY computer, even cell phones.
 
If you have any existing sims you'd like ported over, let me know.
Back to top
 
 
Email View Profile WWW   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: New Gravity Simulator
Reply #10 - 11/10/14 at 18:51:23
 
I've added a few more to the first post in this thread.
Back to top
 
 
Email View Profile WWW   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: New Gravity Simulator
Reply #11 - 06/30/15 at 19:34:31
 
Quote from frankuitaalst on 06/30/15 at 08:27:12:
This is absolutely a wonderful achievement Tony !
I see a lot of new features in the html version compared to the GravSim executable .
Is there any chance the GravSim will get this features also in the future ?

Gravity Simulator is written in Visual Basic 6.0, which can not do a lot of the things HTML5 can do.  HTML5 can take advantage of the new multi-core processors. VB6 is no longer supported by Microsoft, so that won't change.
HTML5 with javascript is much faster, and all platforms can run it.  Here are some sneak previews:
 
In 2029, Apophis comes very close to Earth.  I exaggerated Earth's diameter, so Apophis will hit.  In Windows Gravity Simulator, with the graphics turned off, it took about 20 seconds to propagate Apophis from today to 2029.  In HTML5, it only takes about 6 seconds with the graphics ON. (assuming your computer has the same speed as mine).  Change the DoEvents to 10 for a more enjoyable viewing.  This simulation is a view of Earth from Apophis.
http://orbitsimulator.com/BA/1435715518034_aprelease.html
 
HTML5 gives me multiple layers of graphics.  So I can continuously refresh an object's orbit without wiping out the path it traces.  This simulation of Cruithne is an example.
http://orbitsimulator.com/BA/1435715833482_cruithneRelease.html
 
Soon I'll release the full HTML5 version with all the menus and GUIs I've created this far.
Back to top
 
« Last Edit: 06/30/15 at 23:26:44 by Tony »  
Email View Profile WWW   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: New Gravity Simulator
Reply #12 - 07/01/15 at 10:41:24
 
Again , amazing achievement Tony !
 
I ran the http://orbitsimulator.com/BA/1435715518034_aprelease.html simulation and have following info :  
 
* Apophis crashes to Earth in 2029 . Is this also what you get ?  
* The time slice is 2048 , I can't change it to lower or higher values . The "reverse" however works .  
* Two input buttons seem to interact : pushing the "star field " sometimes triggers the "pre-orbit "feature . Sometimes the "pre-orbit" button doesn't seem to react also .
Back to top
 
 
Email View Profile   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: New Gravity Simulator
Reply #13 - 07/01/15 at 12:53:53
 
Quote from frankuitaalst on 07/01/15 at 10:41:24:
Again , amazing achievement Tony !

I ran the http://orbitsimulator.com/BA/1435715518034_aprelease.html simulation and have following info :

* Apophis crashes to Earth in 2029 . Is this also what you get ?
* The time slice is 2048 , I can't change it to lower or higher values . The "reverse" however works .
* Two input buttons seem to interact : pushing the "star field " sometimes triggers the "pre-orbit "feature . Sometimes the "pre-orbit" button doesn't seem to react also .  

Yes, I exaggerated Earth's diameter by a factor of 10 to create the collision.
Your integrator is set to RK4 variable time step.  It chooses the largest accurate time step for you.  If you want to override that, you have to choose RK4 as your integrator instead of RK4vts.
Which 2 input buttons?  Pre trails should not work in this sim as pre-trails were never generated for any of the objects.  Selecting this should do nothing.  In the Cruithne simulation pre-trails is used.
Back to top
 
 
Email View Profile WWW   IP Logged
frankuitaalst
Ultimate Member
*****


Great site

Posts: 1507
Gender: male
Re: New Gravity Simulator
Reply #14 - 07/01/15 at 13:27:52
 
Thanks , I wasn't aware there was an "optimal" time step avalable .  
Curious : how did you code for this ??? Taking into account the minimum actual distance between bodies ?  
 
I was talking about the buttons :
"stars " and the "pre-trails" which interfere .
Back to top
 
 
Email View Profile   IP Logged
Pages: 1 2 
Send Topic Print