blob: 2544f58dec9a9324e5ee13342126af07b80f1c06 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
clc
clear
//input data
R0=6341.6*10^3 //radius of earth at mean sea-level in m
g=9.809 //acceleration due to gravity in m/s^2
Z1=0 //altitude at sea-level in m
Z2=300*10^3 //altitude above sea-level in m
//calculation
uorb1=R0*sqrt(g/(R0+Z1)) //orbit velocity of a rocket at mean sea level in m/s
uesc1=sqrt(2)*uorb1 //escape velocity of a rocket at mean sea level in m/s
uorb2=R0*sqrt(g/(R0+Z2)) //orbit velocity of a rocket at an altitude of 300 km in m/s
uesc2=sqrt(2)*uorb2 //escape velocity of a rocket at an altitude of 300 km in m/s
//output
printf('(A)orbit and escape velocities of a rocket at mean sea level are %3i m/s and %3i m/s\n (B)orbit and escape velocities of a rocket at an altitude of 300 km are %3.1f m/s and %3.2f m/s',uorb1,uesc1,uorb2,uesc2 )
|