scienalc
- 16
- 0
Homework Statement
I need to develop a macroscopic gravity simulation software. I have problems with representing vectors in a programming language (c++), because I need do develop my own mathematical infrastructure for the project. I asked for the Cartesian coordinates, but would also have no objections to a polar system.
Also I would like to collect some opinion on the correctness of my equations.
Homework Equations
Law of Gravity : Fg = Gm1m2r-2
Newtons second Law : F = ma
The Attempt at a Solution
First, I tried to determine the velocity of the first object (m1):
F = ma = m\frac{dv}{dt} (1)
Gm1m2r-2 = m1\frac{dv}{dt} (2)
v = ∫Gm2r-2dt | integrated from 0 to t (3)
v(t) = Gm2r-2t (4)
Next, I tried similarly to get the dependency of the radius vector r on time:
v = \frac{dr}{dt} (5)
dr = Gm2r-2tdt (6)
∫r2dr = ∫Gm2tdt (7)
\frac{r<sup>3</sup>}{3} = Gm2\frac{t<sup>2</sup>}{2} (8)
r(t) = (\frac{3}{2}Gm2t2)\frac{1}{3} (9)
These results (if correct, of course) need to be supported by an infrastructure which will allow me to calculate the forces, distances, accelerations, velocities, ... between a number of objects. To me it seems the most easy way if I could from the above results somehow get rx, ry and using them vx and vy.
I hope I wasn't confusing.
Thanks a lot
Last edited: