<p>You will always get a &quot;stable&quot; orbit if the stars have less than escape velocity relative to each other. (unless you are modelling the stars as having non-zero radii so they can collide)  The stars will enter into elliptical orbits around a barycentre.</p>
<p>But I guess you want a circular orbit. For a circular orbit the speed <span class="math-container">$v$</span> is given by</p>
<p><span class="math-container">$$v^2=GM/r$$</span></p>
<p>where r is the orbit radius (from the centre of mass), G is Newtons gravitational constant, and M is the reduced mass
<span class="math-container">$$M= \frac{m_1m_2}{m_1+m_2}$$</span>
for stars of mass <span class="math-container">$m_1$</span> and <span class="math-container">$m_2$</span>.</p>
<p>You will find it convenient to use astronomical units (not SI units), so distance in AU, time in years, mass in &quot;solar masses&quot;  In these units <span class="math-container">$G=(2\pi)^{2}$</span> and you avoid difficulties with very large and very small values. (in these units the speed of the Earth is <span class="math-container">$2\pi$</span> AU/year which makes sense)</p>

CC BY-SA 4.0
2020-07-30T23:12:37.140Z
2020-08-02T11:10:33.467Z
2020-08-02T11:10:33.467Z
James K
<p>I am writing a 2D simulation for binary stars orbiting each other. Currently, the initial position of the stars are on opposite sides of the screen with the left star having a velocity up the page and the right star having an equivalent velocity down the page.</p>
<p>The question I have is there a formula for calculating what that initial speed should be so that the stars remain in a stable orbit? Optimally, the formula would take into account the mass of the stars (which are equivalent), the distance apart, and G.</p>
<p>My apologies if this question would be better directed elsewhere or if I overlooked the answer in my own research.</p>
<p>Thank you for your help.</p>

<binary-star><velocity>
Binary Star Initial Speed
Tyler Smith
# Binary Star Initial Speed

(Asked by: username_0 on 2020-07-30)

I am writing a 2D simulation for binary stars orbiting each other. Currently, the initial position of the stars are on opposite sides of the screen with the left star having a velocity up the page and the right star having an equivalent velocity down the page.

The question I have is there a formula for calculating what that initial speed should be so that the stars remain in a stable orbit? Optimally, the formula would take into account the mass of the stars (which are equivalent), the distance apart, and G.

My apologies if this question would be better directed elsewhere or if I overlooked the answer in my own research.

Thank you for your help.

**Tags:** binary-star, velocity


---

## 1 answers

### Answer by username_1 on 2020-07-30. Score: 7 | Accepted answer

You will always get a "stable" orbit if the stars have less than escape velocity relative to each other. (unless you are modelling the stars as having non-zero radii so they can collide) The stars will enter into elliptical orbits around a barycentre.

But I guess you want a circular orbit. For a circular orbit the speed $v$ is given by

$$v^2=GM/r$$

where r is the orbit radius (from the centre of mass), G is Newtons gravitational constant, and M is the reduced mass
$$M= \frac{m\_1m\_2}{m\_1+m\_2}$$
for stars of mass $m\_1$ and $m\_2$.

You will find it convenient to use astronomical units (not SI units), so distance in AU, time in years, mass in "solar masses" In these units $G=(2\pi)^{2}$ and you avoid difficulties with very large and very small values. (in these units the speed of the Earth is $2\pi$ AU/year which makes sense)


---

