New Solar System Simulation Project In Progress

Posted on Posted in C Sharp, C#, Computer Graphics, Math, Non-Tutorial Computer Science, programming, Science, Space

In case you were wondering why I haven’t posted today yet, I’ve been working on a program in C # to simulate the orbits of our solar system.

Basically, an orbit works like this: The planet is accelerating towards the sun, but is moving fast enough in a direction that is not towards the sun that it manages not to, creating an (almost always) elliptical orbit like so:

mockup

Since Position is related to velocity which is related to acceleration through derivatives, my program will make use of the two following equations for orbital velocity and acceleration towards the sun, they can also account for the varying distances every planet orbits the sun at a particular time – none of the orbits in our solar system are perfectly circular:

[latex]ma = F = \frac{Gm_{sun}m_{planet}}{r^2}[/latex]

Since the sun contains 99+% of the Solar System’s mass, this can be approximated to:

[latex]a = \frac{Gm_{sun}}{r^2}[/latex]

where, r stands for orbital radius (current distance of planet to sun), m stands for mass, and G for gravitational constant.

For orbital velocity:

[latex]v = \sqrt{\frac{GM}{r}}[/latex]

where G is the gravitational constant, M is the mass of the sun, and r is again the orbital radius/distance. This is again a slight approximation that is mostly accurate because of the sun’s huge mass relative to a planet.

Here is a teaser of the GUI of my program will probably look like (work in progress!):

Teaser

Expect code and some planets to appear tomorrow!

Please follow and like us:

Leave a Reply

Your email address will not be published.