Electrical rockets have very low thrust-to-mass ratios and are

advertisement
MEAE-4960H02
Numerical Analysis for Engineering
Fall 1999
Final Project
Analysis of Low Thrust-to-Mass
Electrical Rocket for
Escape from Low Earth Orbit
Dennis Chandler
414-19-9717
Table of Contents
List of Symbols Used
pg 3
Abstract
pg 4
Background
pg 4
Introduction
pg 4
Theory
pg 5
Results and Discussion
pg 9
Summary and Conclusions
pg 12
References
pg 13
Appendix
pg 14
2
List of Symbols Used
F
Force in Tangential Direction
G
Universal Gravitational Constant
h
Stepsize
M'
Mass of Planetary Body
m
Mass of Orbiting Body
r
Radius form Center of Planetary Body to Center of Orbiting Body
r0
Initial Radius
t
Time

Force Ratio

Angle (in Radians)

Radius Ratio

Time Ratio
3
ABSTRACT:
The governing equations of motion shall be developed for scenario of achieving escape
velocity from a planetary object using a low thrust-to-weight ratio. The equation of
motion developed will be seen to be a 3rd order differential equation, that can be written
as 3 simultaneous 1st order differential equations. The three 1st order differential
equations shall be solved using the Runge-Kutta 4th Order Method and the Runge-KuttaFehlberg method for error control. The results of the two methods shall be compared,
and the differences discussed.
BACKGROUND:
Electrical rockets have very low thrust-to-mass ratios, thus they are only capable of very
low accelerations. These rockets are only useful after being placed in orbit by
conventional chemical rockets, but once in orbit, these devices can be used to accelerate
continuously over long periods of time until escape velocity is achieved. Since electrical
rockets are power-limited devices, they are best utilized by applying constant power, with
variations in thrust direction to achieve escape velocity. The trajectory of the vehicle
then becomes a gradual outward spiral until the vehicle achieves escape velocity. The
'shape' of the spiral is directly related to the amount of thrust that the engine can
constantly provide.
INTRODUCTION:
The equation of motion for the low thrust-to-mass rocket scenario is a 3rd order
differential equation. However, the problem can be simplified due to the fact that the
equation can be written as three 1st order differential equations. These three differential
equations can be solved using a variety of techniques. For this project, two methods of
Runge-Kutta were used. The RK4 method will be used to generate a first pass at the
solution and for comparison with the other method. The RKF method was chosen to look
at the possibility that this problem needs to be solved to a high degree of accuracy.
Normal methods of solving multiple equations could be used, but the error compounds
4
with each iteration, thus causing a degree of uncertainty in the final results. The degree
of this error is not known, but a comparison between the two methods will allow us to
gauge the error. The RKF method uses a technique of error control to keep the
compounding error to a minimum. The RKF method does this by evaluating the
intermediate answer during each iteration, instead of evaluating the final answer as the
standard RK4 method. If the intermediate answer is not within a certain tolerance band,
the stepsize is decreased, and the intermediate solution is reevaluated. Of course, you
could just make the stepsize small throughout the entire range evaluated, but that would
increase the computing time. This method is efficient because it only uses the smaller
stepsizes when they are needed. Thus cutting down on the amount of time needed to
acquire the final solution. Also, if you cut down the number of stepsizes, you decrease
the amount of error, truncation and/or roundoff that is carried to the end. The only
drawback, if any, to this method for systems of equations is the fact that if the
intermediate solution is not accurate enough for one of the equations, all of the solutions
have to be recalculated to account for the smaller stepsize. This is a minor drawback, and
is easily handled by the addition of a few IF THEN loops. As insinuated in the previous
statement, the RK4 and RKF method were coded in FORTRAN, and a specific scenario
evaluated. The exact code used is contained in the appendix for review. The specific
scenario evaluated was the time required to attain escape velocity from a Low Earth
Orbit of 270 km with an engine Thrust-to-Mass ratio of 0.001g.
THEORY:
The thrust of the tangential motion for the vehicle is
F  m(r  2r)
(where m= mass of vehicle, G=universal Gravity Constant, M' is mass of planetary body,
r is the distance from center of gravity of planetary body to center of gravity of vehicle,
and r0= initial orbital radius.), and

..
. 2
GM ' m

m
(
r

r

)
r2
5
Introducing the dimensionless variables:


r
r0
GM '
t
r03
F r02

M'm
We can write the two equations as:
d 2
d
1
  ( )2  2
2
d
d

and
d
d
 2 d 

  
d 

Taking the initial conditions:
t  0, r  r, r  r0
Then
 2 
GM '
, r  0
r03
And for the dimensionless variables:
d
d
 1,
 0,   1
d
d
Which requires that:
d 2
0
d 2
Which allows the two equations to be combined into the third order differential equation:
d
d
1/ 2
 2 d 2

 
  
2
d


 
6
The above equation is the solution we are seekiing, but cannot be solved directly.
However, the equation can be broken down into the three 1st order equations:
d
A
d
dA B 2  

d
3
dB
 
d
which can be solved by the techniques of numerical integration. The initial conditions
for the equations are:
  1, A  0, B  1
The Runge-Kutta numerical methods of integration is based upon the fundamental
Taylor Series. It can be shown that:

f ( x)  
k 0
f ( k ) ( x0 )
( x  x0 ) k
k!
Thus by intergrating the series, you can arrive at the value of the inegration of the
function. It is not practical to sum the series to infinity, so one must choose how many
terms are to be used to approximate the series. To evaluate the function, derivatives are
taken, not integrations. This technique leads to the difference equation, which is the
backbone of all the numerical techniques of integration of Ordinary Differential
Equations (D.O.E.'s) with Initial Values. Most of the other methods that use this
property, such as Euler's and Difference methods, give good approximations, but have
large errors for large intervals. Taylor's method does have a way of dealing with
truncation error, but the downside to this is the sheer number of calculations that must be
made to alleviate the truncation error. The Runge-Kutta methods are designed to give the
same high-order truncation errors of the Taylor methods, but eliminate the needs to
compute and calculate the derivatives of the function. Since the function can be
evaluated as a summation series, taking the first few terms and evaulating them results in
a method where the function only has to be evaluated at certain mesh points in the
7
interval. This is because after evaulating the series, it can be proved that the integration
is a polynomial with coeffcients that are the same for every problem. The variables
however, must be evaluated for each function. Most are a stepsize (h) times the functions
evaulated at the stepsize, plus the value last evaulated, and then multiplied by a weighting
factor. The final result is a very close approximation of the function at that point in the
interval evaluated. The Runge-Kutta 4th Order Method for systems solves the equations
for each iteration of the functions, and then adds it to the solution before the current
iteration and so one, until the function has been evaluated over the entire interval. One of
the draw backs of this method for systems is that not only is there compounding error, but
the error from the solution of one equation carries over into the calculation of the next
equation. This results in that the compunded errror increases by a factor of how many
equations there are in the system, which for this study is 3. The equation used in the
Runge-Kutta 4th Order Method is:
wi 1  wi 
1
k1  2k2  2k3  k4 
6
Where:
k1  h * f (ti , wi )
k 2  h * f ( ti 
h
1
, wi  k1 )
2
2
k 3  h * f (ti 
h
1
, wi  k 2 )
2
2
k 4  h * f (ti 1 , wi  k3 )
The Runge-Kutta Fehlburg method goes the additional step in reducing error by
evaluating the intermediate solution's error and shortening the stepsize if necessary. This
method reduces the error along the way, thus keeping the error transferred to the next
equation and ultimately the final error to a minimum. The equation used for the RungeKutta Fehlberg solution is:
wi 1  wi 
25
1408
2197
1
k1 
k3 
k 4  k5
216
2565
4104
5
8
Where:
k1  h * f (ti , wi )
h
1
k 2  h * f (ti  , wi  k1 )
4
4
k3  h * f (ti 
k 4  h * f (ti 
3h
3
9
, wi  k1  k 2 )
8
32
32
12h
1932
7200
7296
, wi 
k1 
k2 
k3 )
13
2197
2197
2197
k5  h * f (ti  h, wi 
439
3680
845
k1  8k 2 
k3 
k4 )
216
513
4104
h
8
3544
1859
11
k6  h * f (ti  ' wi  k1  2k 2 
k3 
k 4  k5 )
2
27
2565
4104
40
k6 is used in calcualting the error and does not appear in the integration estimate. As the
above equations reiterate, all that really has to be evaluated is the function at the two
conditions contained within the parenthesis. This is easily done by a computer in
whatever code is available. The above methods were coded in FORTRAN and the results
are to be discussed in the next section.
RESULTS AND DISCUSSION
The first method used was the Runge-Kutta 4th Order Method. Using the initial
conditions, the equations were solved over the time period of 0 - 1500 seconds, with an
interval of N=10,000. As stated before the equation cannot be solved directly, because
there is no 'final' solution. The results give the trajectory of a vehicle as a result of the
forces acting upon it. The solution is used in conjunction with Kepler's Laws to find the
point where the vehicle's velocity is greater than the escape velocity needed. Graph 1
shows the solution to the case being studied using the general solution generated by the
RK4 code. (The method used to generate the curves is contained in the Appendix):
9
Velocities Acquired and Escape Velocity
Runge-Kutta Order Four Method
12000
11000
10000
9000
Velocity (No Units)
8000
7000
Escape Velocity
6000
Vehicle Velocity
5000
Time when
Vehicle Velocity > Escape Velocity:
1050.6
4000
3000
2000
1000
0
0
250
500
750
1000
1250
1500
Time Multiple Required to Travel 1 Radian
Graph 1
As the graph shows, the time at which the vehicle achieves escape velocity is 1050.6 time
units from initial burn. For the case being analyzed, 1 time unit is 14.7323 minutes,
which results in the time from initial burn to escape velocity is 928665 secs (257.96 hrs).
Using the time, Thrust-to-Mass ratio, and Initial energy in orbit, we can calculate the
velocity increment as 1.17602 units. Referencing Hill & Peterson, we see that the
velocity increment should be ~0.933, which gives an error of 26%. Hill & Peterson
reference Tsien, who numerically calculated that the value is 0.900, but this produces an
error of 31%. Clearly, this prediction needs to be refined.
Next, using the Runge-Kutta-Fehlberg Method, Graph 2 was generated using the same
techniques as discussed before:
10
Velocities Acquired and Escape Velocity
Runge-Kutta-Fehlberg Method
12000
11000
10000
9000
8000
Velocity (No Units)
7000
6000
5000
Time when
Vehicle Velocity > Escape Velocity:
795.5
4000
3000
Escape Velocity
Vehicle Velocity
2000
1000
0
-1000
0
100
200
300
400
500
600
700
800
900
1000
-2000
-3000
-4000
Time Multiple Required to Travel 1 Radian
Graph 2
Graph 2 looks very different from Graph 1 in the velocity profiles. This will be discussed
later after the velocity increment is determined. The RKF method predicts that the
vehicle will achieve escape velocity in 795.5 time units, which equates to 703173 secs
(195.32 hrs), shorter than the time predicted by RK4. Going through the same procedure
as before results in a velocity increment of 0.89046, which gives errors of 4.5%
compared to the actual value and 1.06% for the Tsien numerically calculated value. The
RKF method with error control drastically reduced the error in the prediction.
The results clearly show the superiority of the RKF method versus the RK4 method in
solving this system. The compounding error due to roundoff and truncation makes the
RK4 method undesirable for evaluating this system on a time basis. If one looks at the
velocity at which the vehicle escapes the gravity of Earth, the RK4 method predicts
1447.5 and the RKF method predicts 1450.5. The reason for this is that the velocity is
calculated directly from the position of the vehicle, which is what the initial function is.
The velocity increment is calculated from the derivative of the position at the time the
velocity is calculated. The general behavior of these numerical methods shows that they
usually fall 'below' the true solution of the function (see figure 5.3 in Burden-Faires).
While this allows both methods to be accurate in determining the position of the vehicle,
11
when the slope of the point is taken, the RKF method shows itself to be closer to the true
value. Another observation is the profile of the velocities on Graph 1 and 2. Graph 2
shows the velocities initially going up and down. If you look closely at Graph 1, you can
see these same fluctuation, albeit to a much smaller degree. These fluctuations come
about due to the fact that as the vehicle is initially being accelerated, the first few orbits
are 'disturbed' by the acceleration. After time, the 'disturbances' get damped out, and the
vehicle acquires a more stable trajectory. Graph 3 illustrates the first few orbits of the
vehicle:
5
4
3
2
1
0
-5
-4
-3
-2
-1
0
1
2
3
4
5
-1
-2
-3
-4
-5
Graph 3
The initial radius is 1 (=1), then the engine thrust starts, and the orbit gets wobbly.
Finally after sufficient time, the orbit settles down into the gentle spiral that characterizes
this maneuver. The fact that the RKF method captured this phenomena, and the RK4
didn't, further confirms that the RKF method matches the actual solution far better than
the RK4 method.
SUMMARY & CONCLUSIONS:
An equation was developed that described the motion of a vehicle when accelerated
continuously with a low Thrust-to-Mass electrical engine while in a circular Low Earth
12
Orbit. This equation was a 3rd order differential equation that could be broken down into
three 1st order differential equations. The system of three equations were analyzed using
the Runge-Kutta 4th Order Method and Runge-Kutta-Fehlberg Method for 1st order
systems. The RK4 method produced a result that gave an accurate estimation on position
and speed, but when the velocity increment was calculated, it had an error of 26% when
compared to actual measured values. The Runge-Kutta-Fehlberg method also gave good
estimations of position and velocity, and when the velocity increment was calculated, the
estimate was within 1% of the actual measured values. Both methods could be refined
further, by increasing the order of the estimation polynomials or increasing the stepsize of
the evaluation, but for this study, the errors are acceptable. The primary goal of this
study was to compare a method of solving a system with no error correction to a method
that has error correction throughout its calculations. The above problem demonstrates
that the Runge-Kutta-Fehlberg method produces a better estimation than the Runge-Kutta
4th order method. This is due to the fact that the RKF method checks each iteration for
error, and adjusts itself accordingly to minimize it. The RK4 method does not do this,
hence its large error at the end of the calculations. If the methods gave a direct solution,
then both were relatively close. Since the answer sought needed to be derived in part
from the numerical solution of the original equation of motion, the errors in the RK4
method proved to be too high. Therefore, for analysis that requires just the solution to a
differential equation, RK4 and RKF are adequate for the job. However, if part of the
answer that is being sought requires a derivative of the solution to an equation, then the
RKF method needs to used due to the error involved in the RK4 method.
REFERENCES:
Burden & Faires, Numerical Analysis, Sixth Edition, Brooks/Cole Publishing Company,
Pacific Grove, CA, 1997
Hill & Peterson, Mechanics and Thermodynamics of Propulsion, Second edition,
Addison-Wesley Publishing Company, Reading, MA, 1992
13
Appendix
14
Figure 5.3 from Burdern & Faires
Figure from Hill & Peterson
15
Computer Codes
C***********************************************************************
C
*
C
RUNGE-KUTTA FOR SYSTEMS OF DIFFERENTIAL EQUATIONS
*
C
*
C***********************************************************************
C
C
C
C
TO APPROXIMATE THE SOLUTION OF THE MTH-ORDER SYSTEM OF FIRSTC
ORDER INITIAL-VALUE PROBLEMS
C
UJ' = FJ(T,U1,U2,...,UM), J=1,2,...,M
C
A <= T <= B, UJ(A)=ALPHAJ, J=1,2,...,M
C
AT (N+1) EQUALLY SPACED NUMBERS IN THE INTERVAL [A,B].
C
C
INPUT ENDPOINTS A,B; NUMBER OF EQUATIONS M; INTIAL
C
CONDITIONS ALPHA1,...,ALPHAM; INTEGER N.
C
C
OUTPUT APPROXIMATIONS WJ TO UJ(T) AT THE (N+1) VALUES OF T.
C
CHARACTER NAME1*30,AA*1
INTEGER OUP,FLAG
LOGICAL OK
C
CHANGE FUNCTIONF F1, F2, and F3 FOR A NEW PROBLEM
F1(T,X3)=0.001*X3
F2(T,X1,X3)=(X1**2-X3)/(X3**3)
F3(T,X2)=X2
OPEN(UNIT=5,FILE='CON',ACCESS='SEQUENTIAL')
OPEN(UNIT=6,FILE='CON',ACCESS='SEQUENTIAL')
C
DEFINE FUNCTIONS F1,...,FM
WRITE(6,*) 'This is the Runge-Kutta Method for systems with m=3.'
WRITE(6,*) 'Have the functions F1,F2, and F3 been defined?'
WRITE(6,*) 'Enter Y or N '
WRITE(6,*) ' '
READ(5,*) AA
IF(( AA .EQ. 'Y' ) .OR. ( AA .EQ. 'y' )) THEN
OK = .FALSE.
10
IF (OK) GOTO 11
WRITE(6,*) 'Input left and right endpoints separated by'
WRITE(6,*) 'blank'
WRITE(6,*) ' '
READ(5,*) A, B
IF (A.GE.B) THEN
WRITE(6,*) 'Left endpoint must be less'
WRITE(6,*) 'than right endpoint'
ELSE
OK = .TRUE.
ENDIF
GOTO 10
11
OK = .FALSE.
WRITE(6,*) 'Input the three initial conditions.'
WRITE(6,*) ' '
READ(5,*) ALPHA1, ALPHA2, ALPHA3
12
IF (OK) GOTO 13
WRITE(6,*) 'Input a positive integer for the number'
WRITE(6,*) 'of subintervals '
WRITE(6,*) ' '
READ(5,*) N
IF ( N .LE. 0 ) THEN
WRITE(6,*) 'Must be positive integer '
ELSE
OK = .TRUE.
ENDIF
GOTO 12
13
CONTINUE
ELSE
WRITE(6,*) 'The program will end so that the functions'
WRITE(6,*) 'F1, F2, and F3 can be created '
OK = .FALSE.
ENDIF
16
6
C
C
C
C
C
C
C
C
C
C
C
110
C
400
1
IF(.NOT.OK) GOTO 400
WRITE(6,*) 'Select output destination: '
WRITE(6,*) '1. Screen '
WRITE(6,*) '2. Text file '
WRITE(6,*) 'Enter 1 or 2 '
WRITE(6,*) ' '
READ(5,*) FLAG
IF ( FLAG .EQ. 2 ) THEN
WRITE(6,*) 'Input the file name in the form - '
WRITE(6,*) 'drive:name.ext'
WRITE(6,*) 'with the name contained within quotes'
WRITE(6,*) 'as example:
''A:OUTPUT.DTA'' '
WRITE(6,*) ' '
READ(5,*) NAME1
OUP = 3
OPEN(UNIT=OUP,FILE=NAME1,STATUS='NEW')
ELSE
OUP = 6
ENDIF
WRITE(OUP,*) 'RUNGE-KUTTA METHOD FOR SYSTEMS'
WRITE(OUP,6)
FORMAT(12X,'t(i)',11X,'w1(i)',11X,'w2(i)',11X,'w3(i)')
STEP 1
H=(B-A)/N
T=A
STEP 2
W1=ALPHA1
W2=ALPHA2
W3=ALPHA3
STEP 3
WRITE(OUP,1) T,W1,W2,W3
STEP 4
DO 110 I=1,N
STEP 5
X11=H*F1(T,W3)
X12=H*F2(T,W1,W3)
X13=H*F3(T,W2)
STEP 6
X21=H*F1(T+H/2,W3+X13/2)
X22=H*F2(T+H/2,W1+X11/2,W3+X13/2)
X33=H*F3(T+H/2,W2+X12/2)
STEP 7
X31=H*F1(T+H/2,W3+X23/2)
X32=H*F2(T+H/2,W1+X21/2,W3+X23/2)
X33=H*F3(T+H/2,W2+X22/2)
STEP 8
X41=H*F1(T+H,W3+X33)
X42=H*F2(T+H,W1+X31,W3+X33)
X43=H*F3(T+H,W2+X32/2)
STEP 9
W1=W1+(X11+2*X21+2*X31+X41)/6
W2=W2+(X12+2*X22+2*X32+X42)/6
W3=W3+(X13+2*X23+2*X33+X43)/6
STEP 10
T=A+I*H
STEP 11
WRITE(OUP,1) T,W1,W2,W3
CONTINUE
STEP 12
CLOSE(UNIT=5)
CLOSE(UNIT=OUP)
IF(OUP.NE.6) CLOSE(UNIT=6)
STOP
FORMAT(4(1X,E15.8))
END
17
C***********************************************************************
C
*
C
RUNGE-KUTTA-FEHLBERG
*
C
*
C***********************************************************************
C
C
C
C
TO APPROXIMATE THE SOLUTION OF THE INITIAL VALUE PROBLEM
C
Y'=F(T,Y), A<=T<=B, Y(A)=ALPHA,
C
WITH LOCAL TRUNCATION ERROR WITHIN A GIVEN TOLERANCE.
C
C
INPUT:
ENDPOINTS A,B; INITIAL CONDITION ALPHA; TOLERANCE
C
TOL; MAXIMUM STEPSIZE HMAX; MINIMUM STEPSIZE HMIN.
C
C
OUTPUT: T,W,H WHERE W APPROXIMATES Y(T) AND STEPSIZE H
C
WAS USED OR A MESSAGE THAT MINIMUM STEPSIZE WAS EXCEEDED.
C
C
INITIALIZATION AND INPUT
CHARACTER NAME1*30,AA*1
INTEGER OUP,FLAG
LOGICAL OK
C
CHANGE FUNCTIONS F FOR A NEW PROBLEM
F1(T,X3)=v*X3
F2(T,X1,X3)=(X1**2-X3)/(X3**3)
F3(T,X2)=X2
OPEN(UNIT=5,FILE='CON',ACCESS='SEQUENTIAL')
OPEN(UNIT=6,FILE='CON',ACCESS='SEQUENTIAL')
WRITE(6,*) 'This is the Runge-Kutta-Fehlberg Method.'
WRITE(6,*) 'Has the function F been created in the program? '
WRITE(6,*) 'Enter Y or N '
WRITE(6,*) ' '
READ(5,*) AA
IF(( AA .EQ. 'Y' ) .OR. ( AA .EQ. 'y' )) THEN
OK = .FALSE.
10
IF (OK) GOTO 11
WRITE(6,*) 'Input left and right endpoints separated by'
WRITE(6,*) 'blank '
WRITE(6,*) ' '
READ(5,*) A, B
IF (A.GE.B) THEN
WRITE(6,*) 'Left endpoint must be less'
WRITE(6,*) 'than right endpoint'
ELSE
OK = .TRUE.
ENDIF
GOTO 10
11
OK = .FALSE.
13
WRITE(6,*) 'Input the 3 initial conditions'
WRITE(6,*) 'and value for v'
WRITE(6,*) ' '
READ(5,*) ALPHA1, ALPHA2, ALPHA3, v
14
IF (OK) GOTO 15
WRITE(6,*) 'Input tolerance '
WRITE(6,*) ' '
READ(5,*) TOL
IF (TOL.LE.0.0) THEN
WRITE(6,*) 'Tolerance must be positive '
ELSE
OK = .TRUE.
ENDIF
GOTO 14
15
OK = .FALSE.
16
IF (OK) GOTO 17
WRITE(6,*) 'Input minimum and maximum mesh spacing'
WRITE(6,*) 'separated by blank.'
WRITE(6,*) ' '
READ(5,*) HMIN, HMAX
IF ((HMIN.GE.HMAX) .OR. (HMIN.LE.0.0)) THEN
WRITE(6,*) 'Minimum mesh spacing must be positive '
WRITE(6,*) 'and less than maximum mesh spacing.'
18
17
C
C
100
C
ELSE
OK = .TRUE.
ENDIF
GOTO 16
CONTINUE
ELSE
WRITE(6,*) 'The program will end so that the function F '
WRITE(6,*) 'can be created '
OK = .FALSE.
ENDIF
IF(.NOT.OK) GOTO 400
WRITE(6,*) 'Select output destination: '
WRITE(6,*) '1. Screen '
WRITE(6,*) '2. Text file '
WRITE(6,*) 'Enter 1 or 2 '
WRITE(6,*) ' '
READ(5,*) FLAG
IF ( FLAG .EQ. 2 ) THEN
WRITE(6,*) 'Input the file name in the form - '
WRITE(6,*) 'drive:name.ext'
WRITE(6,*) 'with the name contained within quotes'
WRITE(6,*) 'as example:
''A:OUTPUT.DTA'' '
WRITE(6,*) ' '
READ(5,*) NAME1
OUP = 3
OPEN(UNIT=OUP,FILE=NAME1,STATUS='NEW')
ELSE
OUP = 6
ENDIF
WRITE(OUP,*) 'RUNGE-KUTTA-FEHLBERG METHOD'
WRITE(OUP,2)
STEP 1
H=HMAX
W1=ALPHA1
W2=ALPHA2
W3=ALPHA3
T=A
WRITE(OUP,3) T,W1,W2,W3
IFLAG = 1
IFLAG1=0
STEP 2
IF ((T.GE.B) .OR. (IFLAG.NE.1)) GOTO 200
STEP 3
XK11=H*F1(T,W3)
XK21=H*F1(T+H/4,W3+XK11/4)
XK31=H*F1(T+3*H/8,W3+(3*XK11+9*XK21)/32)
XK41=H*F1(T+12*H/13,W3+(1932*XK11-7200*XK21
*
+7296*XK31)/2197)
XK51=H*F1(T+H,W3+439*XK11/216-8*XK21+3680*XK31/513
*
-845*XK41/4104)
XK61=H*F1(T+H/2,W3-8*XK11/27+2*XK21-3544*XK31/2565
*
+1859*XK41/4104-11*XK51/40)
XK12=H*F2(T,W1,W3)
XK22=H*F2(T+H/4, W1+XK12/4, W3+XK12/4)
XK32=H*F2(T+3*H/8, W1+(3*XK12+9*XK22)/32, W3+(3*XK12
*
+9*XK22)/32)
XK42=H*F2(T+12*H/13, W1+(1932*XK12-7200*XK22
*
+7296*XK32)/2197, W3+(1932*XK12-7200*XK22
*
+7296*XK32)/2197)
XK52=H*F2(T+H,W1+439*XK12/216-8*XK22+3680*XK32/513
*
-845*XK42/4104,W3+439*XK12/216-8*XK22+3680*XK32/513
*
-845*XK42/4104)
XK62=H*F2(T+H/2,W1-8*XK12/27+2*XK22-3544*XK32/2565
*
+1859*XK42/4104-11*XK52/40,W3-8*XK12/27+2*XK22*
3544*XK32/2565+1859*XK42/4104-11*XK52/40)
XK13=H*F3(T,W2)
XK23=H*F3(T+H/4,W2+XK13/4)
XK33=H*F3(T+3*H/8,W2+(3*XK13+9*XK23)/32)
XK43=H*F3(T+12*H/13,W2+(1932*XK13-7200*XK23
*
+7296*XK33)/2197)
XK53=H*F3(T+H,W2+439*XK13/216-8*XK23+3680*XK33/513
19
*
*
C
*
*
*
C
C
C
C
C
C
C
C
C
C
-845*XK43/4104)
XK63=H*F3(T+H/2,W2-8*XK13/27+2*XK23-3544*XK33/2565
+1859*XK43/4104-11*XK53/40)
STEP 4
Q=ABS(XK11/360-128*XK31/4275-2197*XK41/75240.0
+XK51/50+2*XK61/55)/H
R=ABS(XK12/360-128*XK32/4275-2197*XK42/75240.0
+XK52/50+2*XK62/55)/H
S=ABS(XK13/360-128*XK33/4275-2197*XK43/75240.0
+XK53/50+2*XK63/55)/H
STEP 5
IF(Q.LE.TOL) THEN
IF(R.LE.TOL) THEN
IF(S.LE.TOL) THEN
STEP 6
APPROXIMATION ACCEPTED
T = T + H
W1=W1+25*XK11/216+1408*XK31/2565+2197*XK41/4104-XK51/5
W2=W2+25*XK12/216+1408*XK32/2565+2197*XK42/4104-XK52/5
W3=W3+25*XK13/216+1408*XK33/2565+2197*XK43/4104-XK53/5
STEP 7
WRITE(OUP,3) T,W1,W2,W3,H
IF(IFLAG1.EQ.1) IFLAG=0
END IF
END IF
END IF
STEP 8
TO AVOID UNDERFLOW
IF (Q.GT.1.0E-20) THEN
DELTA1=.84*(TOL/Q)**.25
ELSE
DELTA1=10.0
END IF
IF (R.GT.1.0E-20) THEN
DELTA2=.84*(TOL/R)**.25
ELSE
DELTA2=10.0
END IF
IF (S.GT.1.0E-20) THEN
DELTA3=.84*(TOL/S)**.25
ELSE
DELTA3=10.0
END IF
IF (DELTA2.LE.DELTA1) THEN
DELTA=DELTA2
ELSE
DELTA=DELTA1
ENDIF
IF (DELTA3.LE.DELTA) THEN
DELTA=DELTA3
ELSE
DELTA=DELTA
ENDIF
STEP 9
CALCULATE NEW H
IF(DELTA.LE..1) THEN
H = .1*H
ELSE
IF(DELTA.GE.4.) THEN
H = 4*H
ELSE
H = DELTA*H
END IF
END IF
STEP 10
IF(H.GT.HMAX) H=HMAX
STEP 11
IF(H.LT.HMIN) THEN
IFLAG=0
WRITE(OUP,4)
ELSE
20
C
C
200
400
2
3
4
IF (T+H.GT.B) THEN
IF (ABS(B-T).LT.TOL) THEN
T=B
ELSE
H=B-T
ENDIF
IFLAG1=1
ENDIF
END IF
GOTO 100
STEP 12
THE PROCESS IS COMPLETE.
CONTINUE
CLOSE(UNIT=5)
CLOSE(UNIT=OUP)
IF(OUP.NE.6) CLOSE(UNIT=6)
STOP
FORMAT(1X,'ORDER OF OUTPUT IS: T,W1(I),W2(I),W3(I),H,R',/)
FORMAT(1X,9(E15.8,1X))
FORMAT(1X,'MINIMAL H EXCEEDED')
END
Sample of Results
Runge-Kutta 4th Order
Tau
0.00
0.15
0.30
0.45
0.60
0.75
0.90
1049.10
1049.25
1049.40
1049.55
1049.70
1049.85
1050.00
1050.15
1050.30
1050.45
1050.60
1050.75
1050.90
1051.05
1051.20
1051.35
1051.50
1051.65
1051.80
1051.95
B
1.0000000000
1.0001500000
1.0002999000
1.0004499000
1.0005999000
1.0007498000
1.0008998000
13.3630540000
13.3715750000
13.3801010000
13.3886320000
13.3971670000
13.4057070000
13.4142520000
13.4228020000
13.4313560000
13.4399170000
13.4484820000
13.4570510000
13.4656260000
13.4742050000
13.4827890000
13.4913780000
13.4999710000
13.5085700000
13.5171730000
13.5257810000
A
0.0000000000
0.0000224542
0.0000895285
0.0002003032
0.0003531984
0.0005460056
0.0007758889
0.3208532900
0.3209530100
0.3210527300
0.3211524200
0.3212521100
0.3213518000
0.3214514900
0.3215511400
0.3216508000
0.3217504600
0.3218500900
0.3219497200
0.3220493500
0.3221489800
0.3222485800
0.3223481800
0.3224477800
0.3225473500
0.3226469200
0.3227464900
Rho
1.0000000000
1.0000008000
1.0000056000
1.0000187000
1.0000445000
1.0000870000
1.0001502000
56.7919390000
56.8240280000
56.8561290000
56.8882370000
56.9203570000
56.9524840000
56.9846230000
57.0167730000
57.0489310000
57.0811000000
57.1132770000
57.1454660000
57.1776660000
57.2098730000
57.2420920000
57.2743230000
57.3065610000
57.3388100000
57.3710670000
57.4033360000
Escape Vel
10930.78618598
10930.78181367
10930.75557991
10930.68398457
10930.54298411
10930.31072781
10929.96537640
1450.46766275
1450.05805935
1449.64864979
1449.23949764
1448.83053902
1448.42183740
1448.01332900
1447.60502640
1447.19696753
1446.78911414
1446.38150409
1445.97408653
1445.56687401
1445.15991692
1444.75315191
1444.34657886
1443.94026068
1443.53414675
1443.12827468
1442.72259396
Vehicle Vel
0.03595200
0.21571200
0.58871396
1.15945200
1.90995025
2.84020724
3.93224843
1443.04168779
1442.61894000
1442.93352000
1442.51112592
1443.78738000
1445.29018679
1444.82100000
1445.18052000
1444.71171885
1446.03438000
1447.53868579
1447.06800000
1447.38258000
1446.95722185
1448.46114000
1449.74221481
1449.27006000
1449.62958000
1449.20272485
1450.66320000
21
Runge-Kutta Fehlberg
Tau
0.00000000
0.10000000
0.20000000
0.30000001
0.40000001
B
1.00000000
1.00010000
1.00020000
1.00030000
1.00040010
A
0.00000000
0.00000000
0.00002103
0.00006311
0.00012600
rho
1.00000000
1.00000000
1.00000000
1.00000230
1.00000890
Escape Vel
10930.78618598
10930.78618598
10930.78618598
10930.77361560
10930.73754431
Vehicle Vel
0.00000000
0.00000000
0.15504298
0.44490600
0.89655309
794.15314000
794.25311000
794.35309000
794.45306000
794.55304000
794.65302000
794.75299000
794.85297000
794.95294000
795.05292000
795.15289000
795.25287000
795.35284000
795.45282000
795.55280000
795.65277000
12.96066600
12.96631700
12.97197100
12.97762600
12.98328300
12.98894300
12.99460500
13.00026900
13.00593500
13.01160300
13.01727400
13.02294600
13.02862100
13.03429800
13.03997700
13.04565800
0.20375529
0.20381707
0.20387883
0.20394060
0.20400237
0.20406413
0.20412590
0.20418766
0.20424943
0.20431119
0.20437296
0.20443472
0.20449649
0.20455825
0.20462002
0.20468178
56.50915500
56.53058600
56.55202100
56.57346300
56.59491300
56.61636700
56.63782900
56.65929800
56.68077100
56.70225100
56.72374000
56.74523500
56.76673500
56.78824200
56.80975700
56.83127600
1454.09236023
1453.81670762
1453.54116031
1453.26567971
1452.99025298
1452.71493148
1452.43966385
1452.16446293
1451.88936715
1451.61433806
1451.33935006
1451.06444157
1450.78962534
1450.51487579
1450.24018017
1449.96558953
1445.09723917
1445.22239448
1445.83897169
1446.23374675
1446.50344069
1447.18757627
1447.51479296
1447.92930879
1448.25645129
1449.00819246
1449.26780356
1449.74992498
1450.07688538
1450.61627325
1451.03109933
1451.35793159
Method for Calculating Velocity Increment
Calculate the initial energy in orbit by the formula:
ucirc 
GM '
ro
With G=6.67E-11 N*m2/kg2 , M'=5.975E24 kg, r0=(270+6371)*1000 m, the energy in
intial orbit is 7746.67 J
To calculate from numercial solution, take time and multiply it by 0.001g (vg), where g =
9.81 m/s2 and v is in units of kg*m/s.
22
Download