- #1
m3the01
- 4
- 0
Most likely a basic question to most, been awhile since I've done any of this.
If i remember right the formula states, F = G*M_1*M_2/d^2
where d = distance between M_1 and M_2
Im creating a planetary simulator for fun, i get the initial position of the Earth using the 7 variable Astrological Guides technique.
iniPos
I then get a position + 1 day in the future call it pos2;
Velocity = pos2-iniPos;
Im using the grav-constant 6.67E-20 km^3/kg*s^2
1)So grav_constant*M_1*M_2 = grav_const*5.9742E24*1.988435E35
= 7.923498687E35
2)The distance between the the two is approx 150 000 000, according to the formula then d^2 = 2.25E16
Force = grav_constant*M_1*M_2/d^2 = 3.52155E19 km*Kg/s^2
Huge number!
Forward Euler update shows us that the 'unit_vector' pointing towards the sun multiplied by the force should give us our update method.
updateVelVector = oldVelVector + unit_vector*force*dt
Where dt = change in time
However this doesn't work worth a damn,
Somewhere I've made a mistake and i just can't see it,
Please help!
PS i tried reducing the problem space to some number which i thought would be easier to use. I decided to decrease the distance to 1 km, basically this turns the problem into earth_mass/1.125E16 and sun_mass/1.125E16. This is wrong too, I am very stuck!
If i remember right the formula states, F = G*M_1*M_2/d^2
where d = distance between M_1 and M_2
Im creating a planetary simulator for fun, i get the initial position of the Earth using the 7 variable Astrological Guides technique.
iniPos
I then get a position + 1 day in the future call it pos2;
Velocity = pos2-iniPos;
Im using the grav-constant 6.67E-20 km^3/kg*s^2
1)So grav_constant*M_1*M_2 = grav_const*5.9742E24*1.988435E35
= 7.923498687E35
2)The distance between the the two is approx 150 000 000, according to the formula then d^2 = 2.25E16
Force = grav_constant*M_1*M_2/d^2 = 3.52155E19 km*Kg/s^2
Huge number!
Forward Euler update shows us that the 'unit_vector' pointing towards the sun multiplied by the force should give us our update method.
updateVelVector = oldVelVector + unit_vector*force*dt
Where dt = change in time
However this doesn't work worth a damn,
Somewhere I've made a mistake and i just can't see it,
Please help!
PS i tried reducing the problem space to some number which i thought would be easier to use. I decided to decrease the distance to 1 km, basically this turns the problem into earth_mass/1.125E16 and sun_mass/1.125E16. This is wrong too, I am very stuck!
Last edited: