Home » Posts tagged 'Earth'

# Tag Archives: Earth

## Escape velocity,Sun and Earth surface

In this example we calculate the acceleration of gravity and the escape velocity at the Sun and Earth surface.

```clc;clear all;
G = 6.67384E-11;                %Gravitational constant,[m^3kg-1s-2]```

## Sun

```Ms = 1.98855e30;                %Solar mass [kg]
Rs = 6.955e8;                   %Solar radius [m]
V_esc = (2*G*Ms/Rs)^0.5/1000;   %Escape velocity [km/s]
g = G*Ms/Rs^2;                  %Acceleration of gravity[m*s-2]
fprintf('Acceleration of gravity[m*s-2] %4.2f \n',g);
fprintf('Escape velocity [km/s] %4.2f \n\n',V_esc);```
```Acceleration of gravity[m*s-2] 274.36
Escape velocity [km/s] 617.76```

## Earth

```Me = 5.98e24;                   %Earth mass [kg]
Re = 6378000;                   %Earth radius [m]
V_esc = (2*G*Me/Re)^0.5/1000;   %[km/s]
g = G*Me/Re^2;                  %Acceleration of gravity[m*s-2]
fprintf('Acceleration of gravity[m*s-2] %4.2f \n',g);
fprintf('Escape velocity [km/s] %4.2f \n',V_esc);%% Earth```
```Acceleration of gravity[m*s-2] 9.81
Escape velocity [km/s] 11.19```

## Two Body Problem Numerical Solution,Satellite – Earth, R & V after dT

The initial position and velocity of an earth orbiting satellite in earth centered inertial frame is known. In this example we will numerically solve fundamental equation of relative two-body motion to find the distance of the satellite from the center of the earth and its speed after 24 hours.

```clc;
clear all;
R0 = [6750 0 0];          %[km]
V0 = [0 10.5 0];          %[km/s]
mu = 398600;            % Earth’s gravitational parameter [km^3/s^2]
t = 0;                  % initial time
dt = 10;                % time step [s]
dT = 24*3600;           % Time interval [s]
% Using fourth-order Runge–Kutta method to solve fundamental equation
% of relative two-body motion
F_r = @(R) -mu/(norm(R)^3)*R;
Rd = V0; R  = R0;
i = 1;
while (t <= dT)
Rv(i,:) = R;
tv(i) =t;
k_1 = dt*F_r(R);
k_2 = dt*F_r(R+0.5*k_1);
k_3 = dt*F_r(R+0.5*k_2);
k_4 = dt*F_r(R+k_3);
Rd  = Rd + (1/6)*(k_1+2*k_2+2*k_3+k_4);
Vv(i,:) = Rd;
R   = R + Rd*dt;
t   = t+dt;
i = i+1;
end
rn = (Rv(:,1).^2+Rv(:,2).^2+Rv(:,3).^2).^0.5;   % Radius Vector
vn = (Vv(:,1).^2+Vv(:,2).^2+Vv(:,3).^2).^0.5;   % Speed Vector
fprintf('Distance from Earth center = %4.2f [km] \n',norm(R));
fprintf('Satellite speed= %4.4f [km/s] \n',norm(Rd));```
```Distance from Earth center = 77061.78 [km]
Satellite speed= 1.5791 [km/s]```

Plots

```figure(1);
hold on;grid on;
plot(tv/3600,rn);
ylabel('Altitude [km]');
xlabel('Time [hour]');
title('Distance variation of the satellite from the center of the Earth');
figure(2);
hold on;grid on;
plot(tv/3600,vn);
ylabel('Speed [km/s]');
xlabel('Time [hour]');
title('Satellite speed variation');  ```