- #1

SacCno

- 2

- 0

- TL;DR Summary
- I'm trying to scale the solar system down to around 1:1,000,000,000 for a game I'm making, need help with scaling formulae, forces, velocities etc.

I'm trying to make a 2D game on Unity similar to Universe Sandbox 2. I currently am working with a star and planet, both with roughly the masses of the sun and earth respectively for comparison and at a distance of 31,000,000km.

My current model uses Newton's formula for gravitational force (F = GM

My issue came when I started the simulation and the ≈30m/s of initial velocity sent the planet shooting off into the cosmos. I've obviously made a big mistake somewhere in my calculations but after a few days of trial and error I still can't figure it out. I asked on the Unity forums and got some really handy tips for my simulation as a whole but nothing seemed to address my issue of how to scale my physics. I suspect that my scaling needs to be done inside the formulae to some degree but I've no idea where to start if that is the case.

Any help would be great, and if you need any more information please let me know.

My current model uses Newton's formula for gravitational force (F = GM

_{1}M_{2}/ R^{2}) and then dividing it by the planet's mass to get acceleration towards the star due to gravity. I then use the formula (v = √GM_{sun}/R) to get the orbital velocity. My full process is as follows.- Calculate force.
- Divide by planet's mass to get acceleration towards the star.
- Calculate orbital velocity.
- Divide both by 1,000,000,000 to get scaled down values.
- Multiply both by 525,600 (minutes in a year) to speed up simulation to one year per minute.

- M
_{sun}= 2e30kg - M
_{earth}= 6e24kg - R = 31units * 1,000,000,000 = 31,000,000,000m
- G = 0.0000000000667

- Unscaled Orbital Velocity = 65,598.97718
**m/s** - Scaled Orbital Velocity = 34.4788224
**m/s**= 34.4788224**units/s** - Unscaled Force = 8.32882414e23
**N** - Scaled Force = 4.37762997e20
**N** - Unscaled Acceleration = 0.1388137357
**m/s/s** - Scaled Acceleration = 7.29604995e-5
**m/s/s**= 7.29604995e-5**units/s/s**

My issue came when I started the simulation and the ≈30m/s of initial velocity sent the planet shooting off into the cosmos. I've obviously made a big mistake somewhere in my calculations but after a few days of trial and error I still can't figure it out. I asked on the Unity forums and got some really handy tips for my simulation as a whole but nothing seemed to address my issue of how to scale my physics. I suspect that my scaling needs to be done inside the formulae to some degree but I've no idea where to start if that is the case.

Any help would be great, and if you need any more information please let me know.