# Setting up initial conditions of parabolic orbits, centre of mass frame

I am writing a simulation of 2 bodies in coplanar parabolic orbits in their centre of mass frame (in C++) and am having difficulties setting up the initial conditions for the velocities.

The total energy of the system should be 0 for a parabolic orbit, and the total momentum must also be 0 for the orbit to have a fixed CoM, with a straight line joining the two bodies through the CoM throughout.

I am unsure however, as to how the initial velocities can then be worked out from this information?

Thanks

• Have you considered working it out in a stationary/lab frame and then converting to the CoM frame? – Kyle Kanos Mar 18 '16 at 12:06
• @KyleKanos Not yet, it ideally needs to be starting off in the CoM frame to make things more straightforward, eg. only having to specify results in this frame and plotting them – user111699 Mar 18 '16 at 12:54

The spacing $d$ gives you the potential energy, and you know the directions of the velocities so you can use the fact the momenta and total energy must sum to zero. This allows you to calculate the velocities from $d$ or conversely $d$ from the velocities. This is particularly simple if the masses are equal but not much harder with unequal masses.