# Modeling a binary star system

I am tasked with modeling a binary star system using VPython. The language itself is relatively irrelevant, as I can deal with the syntax. My problem is with the logic of it and how I should go about structuring the necessary calculations.

## Homework Statement

A binary star system consists of two unequal mass stars that orbit about their center of mass. One star has a mass of 2e30 kg and the other has mass of 1e30 kg. Take the orbital period of the system to be 15 days. Your task is to simulate the binary-star system numerically, assuming that the stars are moving in the x-y plane.

The mass of one star does not dominate the total mass of the system, so you cannot make the approximation that the more massive object does not accelerate due to the force placed on it by the less massive one.

## Homework Equations

Calculate initial velocities for the two stars assuming zero total momentum for the two-body system and a period of 15 days. Evolve the system for 45 days. Use two spheres of different sizes to represent the two stars, and track their orbits.

Make a graph of the x-component of its momentum vs. time. Is either of these graphs constant? Now add the x-components of the momentum of the two particles together and graph the time behavior of the x-component of the total momentum of the binary system. Is this constant in time? Why or why not? Compute the magnitude of the total system momentum and plot it versus time. How close is it to remaining constant? Should it change with time?

## The Attempt at a Solution

Unfortunately, I'm not quite sure how to approach the problem beyond the elementary basics. I am aware that there is a gravitational force between the two stars that must be continuously calculated. However, I suspect center of mass of the two-star system must also be considered, but I don't quite know how, in terms of calculating position.

With any guidance, I'll try my best to proceed and continue as far as I can, but I currently feel stuck at a fairly early stage of programming this simulation. Any assistance will be much-appreciated.

Since there are only two bodies, an analytical solution is possible. You can just get the positions and momenta as functions of time. But initial conditions are a problem: you aren't given any. So you are probably supposed to assume circular orbits, in which case, given the period and the masses, you can establish the orbit and start it anywhere.

Does center of mass play any role? How would I go about calculating the initial velocities?

Assuming the orbits are circular, the center of mass is the center of the orbits.

If the motion is not circular, then it is elliptic, and the the center of mass is at a mutual focus of both orbits.

With the condition that the total momentum is zero, what is the motion of the center of mass?

I would think the COM is not moving at all.

Correct - but only if the total momentum is zero.

So how would I find the initial velocities of the two stars?

First you need to make sure you understand the geometry of the problem. If the smaller star (weight = m) is at displacement r (this is a vector!) from the C. M., what can be said about the displacement of the other star from the C.M.?

First you need to make sure you understand the geometry of the problem. If the smaller star (weight = m) is at displacement r (this is a vector!) from the C. M., what can be said about the displacement of the other star from the C.M.?
Intuitively, I would say the star that is twice as massive would be closer to the CM, but I'm not quite sure if its displacement would be 1/2*r in magnitude.

What is the definition of the center of mass?

What is the definition of the center of mass?
It is basically a point where all of the mass of a system could be considered to be located.

Mathematically, the x-coordinate, for example, of a two-body system (containing mass M and mass m) would be (Mx1 + mx2)/(M+m), where x1 and x2 are the x-coordinates of of M and m, respectively.

I'm sure you asked this question to get me to realize something, probably in regards to the displacement, but I may have missed the point nevertheless.

So, in the vector form, taking r' and R' to be the masses' displacements from some fixed point, the displacement of the C.M. is c = (mr' + MR')/(m + M).

Now let r = r' - c, and R = R' - c, in other words, measure the masses' displacement from the C.M. Then, mr + MR = mr' - mc + MR' + Mc = mr' + MR' - (m + M)c = 0. Thus

R = -(m/M)r.

r and R are vectors, so R is always opposite of r w.r.t. the C. M., and its magnitude is m/M.

What does that mean w.r.t. the radii of the orbits then?

ehild
Homework Helper
It is basically a point where all of the mass of a system could be considered to be located.

Mathematically, the x-coordinate, for example, of a two-body system (containing mass M and mass m) would be (Mx1 + mx2)/(M+m), where x1 and x2 are the x-coordinates of of M and m, respectively.

I'm sure you asked this question to get me to realize something, probably in regards to the displacement, but I may have missed the point nevertheless.
You want to keep the CM stationary. The coordinates of the CM are as you stated. The same equation holds for the velocities: vx(CM)=(vx1m1+vx2m2)/(m1+m2) and vy(CM)=(vy1m1+vy2m2)/(m1+m2)

Vx(CM)=0, Vy(CM)=0. So you need to give the initial velocities accordingly.

ehild