Computer Science Canada Solar System Simulation |
Author: | Cervantes [ Fri Oct 15, 2004 3:39 pm ] |
Post subject: | Solar System Simulation |
I've recently been thinking about making a solar system simulation, using Newtonian physics. Could anyone perhaps give me a quick rundown of what I'll need to know (in terms of the physics, not the coding ![]() |
Author: | josh [ Fri Oct 15, 2004 3:51 pm ] |
Post subject: | |
by simulation do you mean a mathematical one or a 2D or a 3D one??? that is a sick idea by the way ![]() ![]() |
Author: | Cervantes [ Fri Oct 15, 2004 3:58 pm ] |
Post subject: | |
2D, using math. Just the basics, at first. |
Author: | josh [ Fri Oct 15, 2004 4:12 pm ] |
Post subject: | |
I might have some books that mention it, I will try and find some info |
Author: | Martin [ Sat Oct 16, 2004 2:15 am ] |
Post subject: | |
Newton's equations are wrong. |
Author: | Cervantes [ Sat Oct 16, 2004 6:30 am ] |
Post subject: | |
I know, but I still want to use them. Using Newton's equations, don't we end up with circular orbits? And with the General Theory of Relativity, we end up with elliptical oribts? |
Author: | Andy [ Sat Oct 16, 2004 1:41 pm ] |
Post subject: | |
just use centripetal acceleration formulas... where MAc=Fg... with Ac=V^2/r or Ac=4pi^2rf^2 |
Author: | Martin [ Sun Oct 17, 2004 1:29 am ] |
Post subject: | |
Yeah, ignore friction (it's physics, real world forces don't apply), and just give them an initial velocity perpindicular to the object they're to be orbitting, and it should work. Remember, planets pull on each other ![]() And for god's sake, make it OO. |
Author: | Cervantes [ Mon Oct 25, 2004 6:37 pm ] | ||
Post subject: | |||
dodge_tomahawk wrote: just use centripetal acceleration formulas... where MAc=Fg... with Ac=V^2/r or Ac=4pi^2rf^2
would you mind explaining that a little more please? ![]() Martin wrote: Remember, planets pull on each other "wink:
Oh god, I know! I plan on making an initialization section of the program where you can edit the mass of the planets (along with various other things), in which case some funky things could happen.. perhaps with the right mass, the solar system will orbit earth! ![]() Tony showed me a way of creating a gravity field a while back, and it worked well enough for its purpose at that time, but what would it do in a solar system simulation?
See how the ball goes right, then left, then back? Gravity shouldn't do that! ![]() ![]() Why, oh, why, is that? ![]() |
Author: | Tony [ Mon Oct 25, 2004 6:48 pm ] | ||
Post subject: | |||
well you need to give the ball a little push at first to make it spin around the center...
that works out much nicer ![]() ![]() |
Author: | Cervantes [ Mon Oct 25, 2004 6:51 pm ] |
Post subject: | |
Oh, I know, in order to get the orbit it would need that push. But, what I was trying to show, is that, without the push, you'd think it would go straight towards the gravity field, but in fact it wavers back and forth on its way there. |
Author: | Catalyst [ Mon Oct 25, 2004 7:42 pm ] |
Post subject: | |
this might be of some interest |
Author: | Paul [ Mon Oct 25, 2004 10:20 pm ] |
Post subject: | |
Orbits as I understand them are the result of a warping of spacetime due to a large mass present. Since there isn't friction to slow an object down, and given an initial velocity, the object just follows the simplest path, in an orbit. And wasn't there the gravitational force formula, y'know with the mass, distance and the universal gravitational constant. ![]() It doesn't sound easy though, but you like math ![]() and if you look at catalysts program wouldn't the direction and magnitude of the force being exerted on the moving circles have to be somehow balanced with the circle's initial velocity to have an orbit? |
Author: | Cervantes [ Tue Oct 26, 2004 5:53 pm ] |
Post subject: | |
What is the universal gravitational constant? And, catalyst, is what you posted this only open source instead of .exe? My winRAR hates me, and gives me annoying error messages whenever I try to extract something. Could you, or anyone willing, perhaps send it to me as a winzip? I don't want to get offtopic here, but does anyone know where to get a free full version of winRAR (not a trail version)? |
Author: | Andy [ Tue Oct 26, 2004 6:17 pm ] |
Post subject: | |
6.67300 × 10-11 m3 kg-1 s-2 kepler discovered that |
Author: | Catalyst [ Tue Oct 26, 2004 7:32 pm ] |
Post subject: | |
yes it is open source that heres a zip ![]() |
Author: | zylum [ Tue Oct 26, 2004 11:17 pm ] | ||
Post subject: | |||
hey thats pretty cool... but over 400 lines? here's a simpler gravitation class i made:
|
Author: | Tony [ Wed Oct 27, 2004 12:28 am ] |
Post subject: | |
your object representation is quite a bit off... based on mass, radius does not equate to ceil (sqrt (BODY (i)._MASS)) + 1 ![]() V = (4/3)(pi)(R^3) (for the sphere) where V could be replaced by _MASS (assuming same density for all objects)... thus we get R = (3*pi*_MASS/4)**(1/3) I'd recommend calculating that value just once and keeping it in object's record as well ![]() |
Author: | Cervantes [ Wed Oct 27, 2004 7:49 am ] |
Post subject: | |
Ahh, but the densities are not all the same. Earth has the highest density, Saturn has the lowest. I was thinking of hardcoding the values of each planets density and radius and mass. Thanks very much for the zip catalyst, and also thanks to zylum. This will indeed be a complex program for me to make, but I'll try my best ![]() |
Author: | wtd [ Wed Oct 27, 2004 10:21 pm ] |
Post subject: | |
I like your use of data structures, but if I may suggest... there are lots of places where you have x, y pairs. Create a Point or Coordinate, or Vector record type and group them together. |