| Thread Closed |
Physics Simulation |
Share Thread | Thread Tools |
| Sep3-07, 02:36 PM | #1 |
|
|
Physics Simulation
I've written a couple of small physics simulations in the past (hey, everyone has to have a hobby) and now I'm trying to write something a little more complex so decided to attempt to write an program that simulates the motion of the planets and moons in our solar-system entirely procedurally - initially I'm starting off with just the Earth and the Sun.
With the initial values as follows: Mass Sun: 1.989x10^30kg Mass Earth: 5.976x10^24kg Mean distance between the Earth and the Sun: 1.496x10^8km I'm using Newton's law of Universal Gravitation to calculate the gravitational force between the sun and the earth as 3.54476x10^28N I then use F=ma to calculate the earth's acceleration towards the sun and visa versa: Earth towards Sun: 5.93166x10^3ms-1 Sun towards Earth: 1.78218x10^-2ms-1 My problem is, I'm not sure if these results are correct and after a good hour of scouring google and a small pile of physics textbooks I can't seem to find the correct values for my calculations to check these with. If anyone can check the math for me or point me to a site with these values i'd appreciate it greatly. cheers |
| Sep4-07, 01:27 PM | #2 |
|
|
|
| Sep6-07, 09:58 AM | #3 |
|
|
Did u check for the centrifual force?
And one more thing u will obviously get a very small accelaration of sun towards earth. |
| Sep6-07, 10:09 AM | #4 |
|
|
Physics Simulation
They seem okay. Btw, for orbiting systems, Verlet integration is a very good way to go, as it preserves energy in this case.
|
| Jul12-11, 08:19 AM | #5 |
|
|
No you went wrong somewhere you should have got 3.54476E22N
Did you remember to convert the kilometers to meters? 1.496E8km = 1.496E11m The easiest way to do it is in scientific notation simple do the maths on the number and add and subtract the exponentials Mass Sun: 1.989E30 kg Mass Earth: 5.976E24 kg Mean distance between the Earth and the Sun: 1.496E11 m Gravitational constant 6.673E-11 m3 kg-1 s-2 F = G x M1 x M2 / (R x R) = 6.673E-11 x 1.989E30 x 5.976E24 / (1.496E11 x 1.496E11) = 79.317E43 / 2.238E22 = 35.441E21 Newtons (now correct to 1 decimal place for proper scientific notation) = 3.5441E22 Newtons If you want to cheat and not do the maths :-) http://www.ajdesigner.com/phpgravity...tion_force.php |
| Jul12-11, 09:08 AM | #6 |
|
|
Strictly speaking, the force due to gravity is not constant because the distance between a planet and the sun is not constant. The planets do not travel in perfect circles, but in ellipses. So it is best to recalculate the gravitational forces at every time step. This is especially true when you start adding other planets to the simulation, because they exert gravitational forces on each other and do not have constant separations. If you approach the problem generally and apply total forces and find total accelerations for each body (don't treat the sun as special), then you can use the same code to simulate beautiful binary star system trajectories.
By the way, you don't have to program in centrifugal force because it is a fictional force. If you program the gravitational accelerations properly, the apparent effect that we can centrifugal force will appear automatically. |
| Thread Closed |
| Thread Tools | |
Similar Threads for: Physics Simulation
|
||||
| Thread | Forum | Replies | ||
| Need physics simulation software | Programming & Comp Sci | 1 | ||
| List here all the free physics simulation programs | Computing & Technology | 3 | ||
| EFE simulation | Special & General Relativity | 10 | ||
| C++ / Win32 / Physics Simulation | Advanced Physics Homework | 1 | ||
| Discovering the Origin of Life through reverse-time physics simulation. | Chemistry | 2 | ||