如何找到太空中两颗卫星之间的距离?

时间:2015-09-14 17:10:44

标签: physics satellite orbital-mechanics

我想写一个C程序,每隔t秒找到两颗卫星在太空中的距离。我最初的意见是:

  • 初始速度
  • 质量
  • 半径
  • 位置(x,y坐标)

两颗卫星。由于我有初始位置,即两个卫星的x,y坐标(实际上是x,y,z坐标,但为了简单起见,我是x,y),使用毕达哥拉斯定理,我可以找到2颗卫星之间的初始距离。

然后我使用牛顿的万有引力定律计算卫星1对卫星2施加的力。这两颗卫星在两个不同的圆形轨道上连续旋转(例如,一个垂直于地球,另一个水平和相同半径,以便它们可能发生碰撞)。

根据搜索引擎的信息,双重积分加速度可以得出2颗卫星之间的距离。

我正在使用以下方式计算新职位:

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

我正在使用:

linear acceleration = Net force/massOfSat1;
angular acceleration = linear acceleration/radiusOfSat1;

计算a

v_x =initial_angular_velocity_x + a(delta t)
v_y =initial_angular_velocity_y + a(delta t)

这个公式不会给出有效的距离,因为它会不断增加,但我希望距离随着圆周运动而增加和减少,并且卫星也可以靠近或远行。我觉得使用合适的加速公式我会出错。

这是应用概念和公式的正确方法吗?

这是一个很好的网址,看起来类似于我打算做的事情:
http://www.science-animations.com/support-files/gravitasieplaneteb.swf

代码如下:

const double g = 9.8;

void main(){     int delta_t = 0,i = 0,timestep = 0;     double v_x_old1,v_y_old1,v_x_old2,v_y_old2,a,a_x1,a_y1,v_x_new1,v_y_new1,x_new1,x_old1,y_new1,y_old1,r;

printf("\nEnter the time interval delta t:");
scanf("%lf",&timestep);

printf("\nEnter the velocity x component of satellite 1:");
scanf("%lf",&v_x_old1);

printf("\nEnter the velocity y component of satellite 1:");
scanf("%lf",&v_y_old1);

/*printf("\nEnter the velocity x component of satellite 2:");
scanf("%lf",&v_x_old2);

printf("\nEnter the velocity y component of satellite 2:");
scanf("%lf",&v_y_old2);*/
r = 10.00;
x_old1 = 25.00;
y_old1 = 25.00;
a_x1 = 0.0;
a_y1 = 0.0;
while(i<25){

    //satellite 1
    //x_new1 = x_old1 +( v_x_old * delta_t);
    //Now apply a constant acceleration, so that v changes:

    x_new1 = x_old1 + (v_x_old1 *delta_t) + ( (1/2)* a_x1* (pow(delta_t,2.0)));
    v_x_new1 = v_x_old1 + (a_x1* delta_t);
    x_old1 = x_new1;
    v_x_old1 = v_x_new1;

    y_new1 = y_old1 + (v_y_old1 *delta_t )+ ((1/2)* a_y1* (pow(delta_t,2.0)));
    v_y_new1 = v_y_old1 + (a_y1* delta_t);
    y_old1 = y_new1;
    v_y_old1 = v_y_new1;

    a = g/pow(r,2.0);
    a_x1 = (-a* x_new1)/r;
    a_y1 = (-a* y_new1)/r;
    printf("\n a_x1 = %0.3lf",a_x1);
    printf("\n X-coordinate = %0.3lf, Y-coordinate = %0.3lf",x_new1,y_new1);
    delta_t += timestep;
    i++;

}

1 个答案:

答案 0 :(得分:0)

如果不了解物理学,你将无法实现这一目标。

首先,忘记力,加速度和角速度;试着让一个物体以恒定速度移动。首先是这样的:

x = x_0 + v_x t

(假设在t = 0时x = x 0 ),那么就像这样:

x_new = x_old + v_x delta_t

现在应用恒定加速度,以便 v 更改:

x_new = x_old + v_x_old delta_t + (1/2) a_x (delta_t)^2
v_new = v_old + a_x delta_t

现在,物体的行为应该像抛出的球一样落到地上。

一旦它起作用,尝试使用重力加速度朝向空间中的固定点,与距离的平方成反比:

a = g/r^2
a_x = -a x/r
a_y = -a y/r

一旦工作,你可以尝试两个对象施加力量。

相关问题