Periodic and Circular Motion Periodic and Circular Motion Physics Help Forum 
Sep 13th 2015, 10:52 PM

#1  Junior Member
Join Date: Sep 2015
Posts: 11
 What is the formula to find distance between two satellites in space?
I want to write program to find the distance between two artificial satellites in space every 't' seconds. My initial inputs are initial velocity, masses , radii, position(x,y coordinates) of both the satellites. Then using Pythagoras theorem I can find the initial distance between the 2 satellites.
Then I calculate the force exerted by Satellite 1 on Satellite 2. Using Force/mass i need to find the acceleration and double integrate it to get distance between the 2 satellites. The 2 satellites are continuously revolving in 2 different circular orbit(such that they may collide). I have tried using
linear acceleration = Net force/massOfSat1;
angular acceleration = linear acceleration/radiusOfSat1;
This formula does not give a valid distance as the distance keeps on increasing but I expect that the distance increase and decrease as it is circular motion and the satellites can come near or go far as well . I feel that I am going wrong in using a suitable formula for acceleration.
Your help and suggestions will be greatly appreciated.
Thanks

 
Sep 14th 2015, 06:11 AM

#2  Physics Team
Join Date: Jun 2010 Location: Morristown, NJ USA
Posts: 2,331

It's quite possible that the distances between the two bodies will continue to increase, if the initial velocity that you picked is greater than escape velocity of either body. However, just to check your procedure: it seems you are doing all calculations in Cartesian coordinates, correct? That's OK, but of course this means that the acceleration vector due to gravitational attraction has both x and ycomponents, so I assume you are calculating the new position using x_1 = x_0 + v_x delta_t + (1/2)a (delta_t)^2 and y_1 = y_0 + v_y delta_t + (1/2) a (delta_)t)^2. Is that what you meant by doing a double integral?

 
Sep 14th 2015, 08:06 AM

#3  Junior Member
Join Date: Sep 2015
Posts: 11

Yes. I am calculating new position using x_1 nad y_1 formulas. I am using angular acceleration= linear acceleration/radiusSat1 to compute "a" and v_x =initial_angular_velocity_x + a(delta t) and v_y =initial_angular_velocity_y + a(delta t). Is this the correct way of applying the concept and formula?

 
Sep 15th 2015, 04:50 AM

#4  Physics Team
Join Date: Jun 2010 Location: Morristown, NJ USA
Posts: 2,331

I don't understand what you mean by angular acceleration here. You are using cartesian coordinates, not polar coordinates, correct? Force (and acceleration) of each object is always in the direction of the other object. That force (and acceleration) have both x and ycomponents, but I wouldn't call it angular.
Also  when you mentioned radii in your first post I assumed you meant the radius of each object, but now I'm thinking perhaps you mean distance between objects. Please clarify what you mean. Finally, the formula that you referenced: "angular acceleration= linear acceleration/radiusSat," is incorrect. Again, angular acceleration applies to a polar coordinate system, but even so in this case there is no angular acceleration.
Finally, this part: "v_x =initial_angular_velocity_x + a(delta t) and v_y =initial_angular_velocity_y + a(delta t)," is incorrect as well. You have to determine the x and ycomponents of acceleration  they are not the same.
At this point I suggest that you rethink how you have set this problem up. One suggestion: set the origin of your coordinate system at the baryceter of the two objects (that's the center of mass). The reason is that the two bodies essentially orbit about the barycenter, and the gravitational forces, and accelerations, always act in the direction of the barycenter, so it makes the math a bit easier to comprehend.

 
Sep 15th 2015, 07:46 AM

#5  Junior Member
Join Date: Sep 2015
Posts: 11

Originally Posted by ChipB I don't understand what you mean by angular acceleration here. You are using cartesian coordinates, not polar coordinates, correct? Force (and acceleration) of each object is always in the direction of the other object. That force (and acceleration) have both x and ycomponents, but I wouldn't call it angular.
Also  when you mentioned radii in your first post I assumed you meant the radius of each object, but now I'm thinking perhaps you mean distance between objects. Please clarify what you mean. Finally, the formula that you referenced: "angular acceleration= linear acceleration/radiusSat," is incorrect. Again, angular acceleration applies to a polar coordinate system, but even so in this case there is no angular acceleration.
Finally, this part: "v_x =initial_angular_velocity_x + a(delta t) and v_y =initial_angular_velocity_y + a(delta t)," is incorrect as well. You have to determine the x and ycomponents of acceleration  they are not the same.
At this point I suggest that you rethink how you have set this problem up. One suggestion: set the origin of your coordinate system at the baryceter of the two objects (that's the center of mass). The reason is that the two bodies essentially orbit about the barycenter, and the gravitational forces, and accelerations, always act in the direction of the barycenter, so it makes the math a bit easier to comprehend. 
Thank you for the reply. I am using cartesian coordinates, not polar. I am not good at physics and may be messing with the formulas. It would be of great help if you could suggest me the formula I need to use in my code to get the distance between two revolving satellites. I was told that if I get the force exerted (x,y components) by satelliteA on satelliteB then I can calculate acceleration using F=ma. Then integrate acceleration to get velocity and integrate velocity to get distance. I am not able to get this idea working.. Not sure if it is correct.. I know it is not perfect as per astrophysics. There are many factors that affect a satellite motion. but my aim is to develop a simple animation which follows basic physics formulae.

 
Sep 15th 2015, 09:50 AM

#6  Physics Team
Join Date: Jun 2010 Location: Morristown, NJ USA
Posts: 2,331

OK, here's how I would go about it.
Let's define position of object 1 as x1 and y1, and its mass is M1, it's initial components of velocity are vx1 and vy1. Similarly for object 2: x2, y2. M2, vx2, vy2.
The distance D between objects is D = sqrt((x1x2)^2 + (y1y2)^2)
The gravitation force pulling on each object is F1 = GM1M2/D^2. The direction of that force operating on object 1 is the angle theta1 = arctan((y2y1)/(x2x1)). Here's where it gets tricky: since arctan function always returns a value between pi/2 and +pi/2, you may have to add or subtract pi to that angle depending on the relative positions of the objects (i.e. if x2x1 is negative).
To get acceleration of M1 you divide force by its mass, leaving:
ax1 = F cos(theta1)/M1, ay1 = F sin(theta1)/M1
For M2 the angle that the force operates on is the opposite of the direction of the force on M1, so add or subtract pi: theta2 = theta1 +/ pi.
ax2 = F cos(theta_2)/M2, ay2 = F sin(theta2)/M2
Now for incremental movement of M1:
vx1_new = vx1_old + ax1 (delta_t), vy1_new = vy1_old + a1y(delta_t
vy2_new = vy2_old + ay2 (delta_t), vy2_new = vy2_old + a2y (delta_t)
x1_new = x1_old +vx1_old (delta_t) + (1/2)ax1 delta_t)^2
y1_new = y1_old + vy1_old (delta_t) + (1/2)ay1 (delta_t)^2
x2_new = x2_old +vx2_old (delta_t) + (1/2)ax2 delta_t)^2
y1_new = y2_old + vy2_old (delta_t) + (1/2)ay2 (delta_t)^2
Hope this helps!

 
Sep 16th 2015, 03:53 AM

#7  Junior Member
Join Date: Sep 2015
Posts: 11

Thanks a lot for the step by step explanation. I am coding based on it.
I was not able to understand this step. "Here's where it gets tricky: since arctan function always returns a value between pi/2 and +pi/2, you may have to add or subtract pi to that angle depending on the relative positions of the objects (i.e. if x2x1 is negative). " I understood that adding PI gives an angle in the 3rd or 4th quadrant. That is, when x2x1 is negative(correct me if am wrong). When am I supposed to subtract PI? What condition should be satisfied to subtract PI from the angle?

 
Sep 16th 2015, 04:34 AM

#8  Physics Team
Join Date: Jun 2010 Location: Morristown, NJ USA
Posts: 2,331

It doesn't matter whether you add or subtract pi  in either case you convert an angle from quadrant 1 to quadrant 3, or from quadrant 4 to quadrant 2.

 
Sep 16th 2015, 11:55 AM

#9  Junior Member
Join Date: Sep 2015
Posts: 11

I tried executing the program.
If I plot the values obtained for (x1_new , y1_new) or( x2_new,y2_new), I am getting a linear line passing through the origin. I thought I should get a circular path.Also the distance D is continuously increasing instead of increasing and decreasing as the satellites move near or far. I am not sure if something is going wrong in my interpretation. Here is my C code: Code: //Let's define position of object 1 as x1 and y1, and its mass is M1, it's initial components of velocity are vx1 and vy1.
//Similarly for object 2: x2, y2. M2, vx2, vy2.
double x1,y1,x2,y2,M1,M2,ax1,ay1,ax2,ay2,theta1,theta2,D,vx1_new,vx1_old,vy1_new,vy1_old,vx2_new,vx2_old,vy2_new,vy2_old;
double temp_x,temp_y,F;
double x1_old,x2_old,y1_old,y2_old,x1_new,x2_new,y1_new,y2_new;
int timestep=0,i=0,delta_t=0,j=0;
timestep = 60;
x1 = 4.0;
y1 = 2.0;
x2 = 51.0;
y2 = 18.0;
M1 = 50;
M2 = 10;
vx1_old = 20;
vy1_old = 50;
vx2_old = 10;
vy2_old = 10;
x1_old = x1;
y1_old = y1;
x2_old = x2;
y2_old = y2;
while(i<200){
temp_x = x1x2;
temp_y = y1y2;
//The distance D between objects is D = sqrt((x1x2)^2 + (y1y2)^2)
D = sqrt(pow(temp_x,2.0) + pow(temp_y,2.0));
//The gravitation force pulling on each object is F1 = GM1M2/D^2.
F = (G*M1*M2)/(pow(D,2.0));
//The direction of that force operating on object 1 is the angle theta1 = arctan((y2y1)/(x2x1)).
//Here's where it gets tricky: since arctan function always returns a value between pi/2 and +pi/2,
//you may have to add or subtract pi to that angle depending on the relative positions of the objects (i.e. if x2x1 is negative).
temp_x = x2x1;
theta1 = atan((y2y1)/(x2x1));
if(temp_x < 0){
theta1 += PI;
}
printf("\nTheta1 = %0.3lf\n",theta1);
//To get acceleration of M1 you divide force by its mass, leaving:
ax1 = (F* cos(theta1))/M1;
ay1 = (F* sin(theta1))/M1;
//For M2 the angle that the force operates on is the opposite of the direction of the force on M1, so add or subtract pi: theta2 = theta1 +/ pi.
if(theta1 <0){
theta2 = theta1  PI;
}else{
theta2 = theta1 + PI;
}
ax2 = (F* cos(theta2))/M2;
ay2 = (F* sin(theta2))/M2;
//Now for incremental movement of M1:
vx1_new = vx1_old + (ax1 * delta_t);
vy1_new = vy1_old + (ay1 * delta_t);
vx2_new = vx2_old + (ax2 * delta_t);
vy2_new = vy2_old + (ay2 * delta_t);
vx1_old = vx1_new;
vy1_old = vy1_new;
vx2_old = vx2_new;
vy2_old = vy2_new;
x1_new = x1_old + (vx1_old * delta_t) + ((1/2) * ax1 * pow(delta_t,2.0));
y1_new = y1_old + (vy1_old * delta_t) + ((1/2) * ay1 * pow(delta_t,2.0));
x2_new = x2_old + (vx2_old * delta_t) + ((1/2) * ax2 * pow(delta_t,2.0));
y2_new = y2_old + (vy2_old * delta_t) + ((1/2) * ay2 * pow(delta_t,2.0));
x1_old = x1_new;
y1_old = y1_new;
x2_old = x2_new;
y2_old = y2_new;
printf("\nx1_new = %0.3lf,y1_new = %0.3lf",x1_new,y1_new);
printf("\nx2_new = %0.3lf,y2_new = %0.3lf",x2_new,y2_new);
x1= x1_new;
y1 = y1_new;
x2 = x2_new;
y2 = y2_new;
i++;
delta_t += timestep;
}//end while 
 
Sep 16th 2015, 12:41 PM

#10  Physics Team
Join Date: Jun 2010 Location: Morristown, NJ USA
Posts: 2,331

I'll look at it more closely, but one thing that popped right out to me is that I don't think you defined G. If G is set to 0 then there is no gravitational force and the two objects would just travel in straight lines. I also don't see a definition of the variable PI. And I think your time step is way too big  if the initial velocities are on the order of 20 m/s, and initial distances are on the order of 60 meters, then making time step = 60 seconds seems to me to be much too large. You are also using delta_t incorrectly = the statement at the end of the while loop delta_t += timestep is not right. Delta_t is a constant, it doesn't get incremented.
A couple of other suggestion regarding debugging a program like this:
1. You should have the program print out values for acceleration and velocity, so you can see if they are "reasonable."
2. Set initial conditions to something real simple and see if the system behaves as expected. For example you can set both masses equal, initial velocities to zero, place mass 1 at the origin (0,0) and mass 2 somewhere along the xaxis  say at (50,0)  and see if the two masses are attracted accelerate toward each other and collide. If they don't, then you know something is wrong.
3. If you get it to work, you might also try using values for the Earth and Moon to test the accuracy of the program.
Update: I was able to create a simulation of the two bodies orbiting using this technique (I actually did it in an Excel spreadsheet, rather than programming), and I found that it works, sort of. There is an issue based on the fact that the formulas we are using for position and velocity are based on an assumption that acceleration is constant throughout the delta_t time increment, but acceleration varies with time as the distance between the object varies. Hence the calculations introduce some amount of error, and as you go through the iterative calculations that error grows in magnitude. You can address that in two ways which help, but it's still not perfect. First, make the delta_t increment as small as you can, and second, you can improve things by assuming that a is a linear function a(t) = A+Bt, which will give better results. The value for B is the slope of acceleration: B= (A_new  A_old)/delta_t. Integrating this gives formulas:
v_new = v_old + A delta_t + B delta_t^2/2
x_new = x_old + v delta_t + A delta_2^2/2 + B delta_t^3/6
See the attached results  you can see that the orbit doesn't quite close on itself like it should. If you get ambitious you might think of other curve fitting approaches for a(t) that may give even better accuracy.
Last edited by ChipB; Sep 16th 2015 at 02:32 PM.

  Search tags for this page 
Click on a term to search for related topics.
 Thread Tools   Display Modes  Linear Mode  