Trajectories in Nordic Ski Jumping MEAE 4960-H01 Numerical Analysis for Engineering

advertisement
Trajectories in Nordic Ski Jumping
MEAE 4960-H01
Numerical Analysis for Engineering
Prof. Ernesto Gutierrez-Miravete
Michael Baran
04/10/01
Table of Contents
Table of Contents ................................................................................................................ 2
List of Symbols (all units are metric) ................................................................................. 3
List of Tables ...................................................................................................................... 4
Introduction ......................................................................................................................... 5
Description and Formulation of the Problem...................................................................... 6
Numerical Methods for Solving.......................................................................................... 8
Results ............................................................................................................................... 11
Error Analysis ................................................................................................................... 13
Conclusion/Discussion...................................................................................................... 14
Appendix A- Program Source Code (RK4.f) .................................................................... 15
Appendix B- Program Source Code (RK5.c) ................................................................... 18
Appendix C- Program Source Code (RKF.c) ................................................................... 22
Appendix D- Tabulated Results of all Programs .............................................................. 28
References ......................................................................................................................... 37
2
List of Symbols (all units are metric)
m
v
g



A
CD
CL
x
y
t
h
i,j
fv
f

fx
fy
k1,i
k2,i
k3,i
k4,i
k5,i
k6,i
vtemp
temp
xtemp
ytemp
TOL
Ri

mass of the skier
velocity
gravitational constant = 9.81 ms-2
angle of attack
density of the medium through which the skier is flying
skiers frontal area
coefficient of drag
coefficient of lift
location of skier in the horizontal direction from the point of reference
location of skier in the vertical direction from the point of reference
time
step size
counters
function defining the derivative of the velocity with respect to time
function defining the derivative of the velocity angle with respect to time
function defining the derivative of the x distance with respect to time
function defining the derivative of the y distance with respect to time
Runge-Kutta constant for each step
Runge-Kutta constant for each step
Runge-Kutta constant for each step
Runge-Kutta constant for each step
Runge-Kutta constant for each step
Runge-Kutta constant for each step
temporary velocity assignment
temporary angle assignment
temporary x assignment
temporary y assignment
tolerance
error term
step size corrector term
3
List of Tables
Table 1 Summary of Runge-Kutta Methods ..................................................................... 11
Table 2 Summary of Runge-Kutta-Fehlberg Method ....................................................... 11
Table 3 Error Analysis for Runge-Kutta Methods ............................................................ 13
Table 4 Summary of Errors in Runge-Kutta-Fehlberg Method ........................................ 13
Table 5 Runge-Kutta 4th Order h=0.1 .............................................................................. 28
Table 6 Runge-Kutta 4th Order h=0.01 ............................................................................ 29
Table 7 Runge-Kutta 4th Order h=0.001 .......................................................................... 30
Table 8 Runge-Kutta 5th Order h=0.1 .............................................................................. 31
Table 9 Runge-Kutta 5th Order h=0.01 ............................................................................. 32
Table 10 Runge-Kutta 5th Order h=0.001 ........................................................................ 33
Table 11 Rung-Kutta-Fehlberg (hmin=0.00001, hmax=0.01,TOL=0.00001) .................. 34
Table 12 Runge-Kutta-Fehlberg Error for TOL=.00001 .................................................. 36
4
Introduction
Competitive sports have been around for many eras. From the days of chariot
racing to modern day car racing, man has always been captivated by the excitement of
competing and to be known as the best at a certain sport. In the early years the better
man was always based on strength, speed, and agility. This is still true today except
science has also taken a place in the competitive sport world. A good example of this, is
the competitive sport of Nordic ski jumping.
Nordic ski jumping is nothing more than skiing down a steep incline and
launching yourself off of a ramp. The skier who manages to jump the furthest without
falling wins. Although this seems simple enough, there is so much more behind this
sport than meets the eye. As scientist, mathematicians, and engineers study the physics
behind the sport, they find ways to optimize certain aspects to help the skier travel
further. There are many factors that can limit the distance a skier can jump that he cannot
control. Some factors include; wind, friction, gravity, etc. Although we are not able to
eliminate or control these factors, there are ways to minimize their affect. This is where
science comes in. There are continuous changes made to skies the reduce friction, skiers
wear special suits to reduce the amount of air friction, the angle at which the skier takes
off of the jump, and the angle of the jump itself all can be modified to reduce the limiting
factors. This project will approximate the flight path (trajectory) of a ski jumper and
estimate the point at which he/she will land at a certain point in time. This is
accomplished by developing the governing equations of the skiers motion, imposing
some initial conditions, determining a set of numerical methods to approximate the
solution to the equations, and performing an error analysis on the solutions to check the
accuracy.
5
Description and Formulation of the Problem
The trajectory of a ski jumper can be defined using equations of the tangential and
normal directions of the skier over a certain amount of time. The following equations
taken from DeMestre assume that the only forces acting on the skier are gravity, lift, and
air friction (drag).
In the tangential direction the following equations apply:
m
dv
1
 mg sin(  )  v 2 AC D
dt
2
And
m
d
1
 mg cos( )  v 2 AC L
dt
2
In the normal direction the following equations apply:
dx
 v cos( )
dt
And
dy
 v sin(  )
dt
In the first tangential equation, it is seen that the second half of the equation
consists of the affect of drag on the skier. It takes into account the skiers’ frontal area,
the density of the medium (air), the coefficient of drag (CD), and the square of the
velocity of the skier.
In the second tangential equation, the second half of the equation is the same as
the first equation except it is calculating the affect of lift on the skier using the lift
coeffcient (CL).
The equations describing the normal direction of the skier are much simpler.
They describe the x and y components of the skier throughout his flight and only consist
of the velocity and the angle of attack (
A set of initial conditions (starting point) must be set in order to solve this system
of equations. In de Mestre’s paper he defines a problem of a ski jumper with appropriate
initial conditions. These initial conditions will be used in this paper in order to compare
my solution with the printed solution in his paper. The problem reads as follows:
6
“A Nordic ski-jumper with his skis on has a mass of70kg, and his frontal area in the
jumping position through the air is 0.7m2. At a certain jumping altitude the air density is
1.007 kg m-3 and the value of g is 9.81ms-2. If the drag and lift forces are proportional to
the square of the speed with CD=1.78, CL=0.44 and his velocity at the take-off point is 15
ms-1 in the horizontal direction, determine where he will land on the hill-slope whose
angle is 45. The take –off point is 10 metres vertically above the slope.”
Using the numerical values given by de Mestre, the preceding tangential equations can be
rewritten as:
dv
 9.81sin(  )  0.00899v 2
dt
and
d  9.81cos( )  0.00223v 2

dt
v
Each of the four equations discussed above are dependant on time. This means that to
approximate the point at which the ski jumper is going to land, one must calculate where
that jumper is at several points in time. All four equations must also be solved
simultaneously since they are also dependant on each other. There are several ways to
solve this problem and they will be discussed in the next section.
7
Numerical Methods for Solving
As mentioned in the previous section, there are many different approaches to this
problem. The approach that de Mestre recommends is using a Runge-Kutta 4th order
technique with time-step 0.01 seconds. This is the first method that I will use to solve the
problem. I will also change the time-step size to compare the amount of effort versus the
amount of accuracy and error are computed.
The Runge-Kutta technique that I will use is called Runge-Kutta method of order
four. The order four means that there are four evaluations of the variables per time-step.
This will give more accurate solutions when compared to techniques like Euler’s method,
with one-fourth the step size. The procedure that a Runge-Kutta method uses to arrive at
a solution will now be discussed.
To approximate the solution of a mth-order system of first-order initial value
problems u’j=fj(t,u1,u2,…,um) with uj(a)=j, for I=a,2,…,m at (N+1) equally spaced
numbers equal to the time-step (h).
INPUT: time-step (h), number of equations (m), initial conditions 1,2,..m.
NOTE: This is being described in the general case, in the problem m=4 and h will
be the only value changing.
OUTPUT: approximations of wj to uj(t) at the (N+1) values of t.
STEP1: Set h=.001 and t=0 Starting point.
STEP2: For j=1,2,..,m, set wj=j. Setting initial conditions.
STEP3: For i=1,2,..,N do steps 5-11 Setting up loop to continuously calculate the
values.
STEP4: For j=1,2,…m set Calculating K1,j
K1,j=hfj(t,w1,w2,…wm)
STEP5: For j=1,2,…m set Calculating K2,j
K2,j=hfj(t+h/2,w1+1/2k1,1,w2+1/2k1,2,…wm+1/2k1,m)
STEP6: For j=1,2,…m set Calculating K3,j
K3,j=hfj(t+h/2,w1+1/2k2,1,w2+1/2k2,2,…wm+1/2k2,m)
STEP7: For j=1,2,…m set Calculating K4,j
K4,j=hfj(t+h,w1+k3,1,w2+k3,1,…wm+k3,m)
STEP8: For j=1,2,…m set
8
wj=wj+(k1,j+2k2,j+2k3,j+k4,j)/6
STEP10: Set t=t+h Increasing the time step
STEP11: OUTPUT(t,w1,w2,…,wm) Print the solutions.
The loop will continue calculating until the absolute value of y minus the absolute
value of x is greater than 10. When this condition is met, the skier has hit the ground and
the calculations can cease. To do this algorithm by hand would be time consuming and
lead to many possibilities of computational error. This algorithm was put into a Fortran
program that will do these calculations in a matter of seconds. It also allows use to
change the step size very easily to obtain the accuracy we require. Due to my lack of
knowledge of programming, the source code for this algorithm was taken from the
Burden and Faires1 program diskette and then modified to solve the exact problem. The
source code can be found in Appendix A of this paper and the tabulated results can be
found in Appendix C.
Although the Runge-Kutta method is a good approximation to the problem, it is
far from being the best. The draw back of the Runge-Kutta method is that it uses a
constant step-size, which induces error. A better approximation method is the RungeKutta-Fehlberg. This method is basically the regular Runge-Kutta Method except is
adjusts the time steps as need to reach a solution within a certain tolerance. This is more
useful in practice because you are allowed to enter a tolerance that you would like to
achieve and let the program do the work to get to that accuracy. The following is the
procedure that the Runge-Kutta-Fehlberg method follows to arrive at a solution.
INPUT: Minimum step-size (hmin), Maximum step-size (hmax),number of equations (m),
initial conditions 1,2,..m, Tolerance (TOL)
NOTE: This is being described in the general case, in the problem m=4 and hmin,
hmax, and TOL will be changing.
OUTPUT: approximations of vj, j, xj, yj at the (N+1) values of t.
STEP1: Set t=0, wj=j, h=hmax  Set initial conditions
STEP2: Start Loop Condition to loop calculations until TOL is met, see Appendix B
STEP3: Set
K1,j = hfj(t,wj) Calculate the values of K
K2,j = hfj(t+.25h,wj+.25K1,j)
K3,j = hfj(t+.375h, wj +(3K1,j+9K2,j)/32)
K4,j = hfj(t+(12/13)h,wj + (1932K1,j-7200K2,j+7296K3,j)/2197)
K5,j = hfj (t+h, wj + (439/216)K1,j – 8K2,j + (3680/513)K3,j –
(845/4104)K4,j)
K6,j = hfj (t+.5h, wj – (8/27)K1,j + 2K2,j –(3544/2565)K3,j + (1859/4104)K4,j
– (11/40)K5,j)
9
STEP4: Set R=1/h|(K1,j/360) - (128/4275)K2,j – (2197/75240)K3,j + (K5,j/50) + (2/55)K6,j|
STEP5: If R  TOL then do steps 6 & 7 The check to change time-step.
STEP6: Set t=t+h Approximation accepted.
wj = wj + (25/216)K1,j + (1408/2565)K3,j + (2197/4104)K4,j – K5,j/5
STEP7: OUTPUT (t, wj, h) Print approximations where wj = (v, , x, y)
STEP8: Set  = 0.84(TOL/R)1/4
STEP9: If   0.1 then set h=0.1h Calculate new h
else if   4 then set h=4h
else set h=h
STEP10: if h > hmax then h = hmax Don’t let h exceed hmax
STEP11: Until (|y| - |x|) > 10 Stop when skier hits ground
The 5th order Runge-Kutta method was performed to calculate the error in the 4th
order Runge-Kutta method, this will be discussed further in the Error Analysis section.
The procedure for the 5th order is the same as the Runge-Kutta-Fehlberg Method except
is does not adjust the time step nor does it check for accuracy. What is the same are the
formulas for the K variables. The full program source, which was taken from Anna
Kazmierczak3 and slightly modified, can be found in Appendix B.
Unlike the Runge-Kutta methods where it stops calculating when |y|-|x| <10, the
Runge-Kutta-Fehlberg method stops when |y|-|x| <10.00000. The Fehlberg method
checks each value of R (local truncation error) to verify if it is within tolerance, if any of
the R’s are not in tolerance then the whole procedure is re-calculated. This gives a much
better approximation of the solution than the fixed step methods. I attempted to modify
the Burden and Faires1 version of the Runge-Kutta-Fehlberg FORTRAN program to
solve this particular problem but was unable to get it to work properly. A C++ program
written by Anna Kazmierczak3 was modify slightly and used to obtain my results. Again,
due to my lack of programming knowledge I had to find other sources of programming
code that need little modifications to solve my problem. That source code can be seen in
Appendix A.
10
Results
After making several runs of each of the programs listed above, numerous lines of
data have been collected. The full list of data can be found in Appendix D. The
following tables summarize the results of three runs of the Runge-Kutta 4th & 5th order
techniques with h=.1, .01, .001. The distance is simply (x2+y2)1/2.
Table 1 Summary of Runge-Kutta Methods
Step
Size(h)
0.1
0.01
0.001
i
t
39
389
3,883
3.8
3.89
3.88290
0.1
0.01
0.001
39
389
3886
3.90
3.89
3.89
Runge-Kutta 4th Order
v
psi
x
26.54506 -1.19640 45.74809
26.79240 -1.20306 46.61836
26.77348 -1.20255 46.55095
Runge-Kutta 5th Order
26.80544 -1.20764 46.57445
26.78707 -1.20310 46.61885
26.77723 -1.20243 46.59577
y
Distance
-54.50115 71.15661
-56.73809 73.43352
-56.56320 73.25596
-56.77442 73.43374
-56.69027 73.39689
-56.60814 73.31881
It is seen by the data above that as you decrease the step size, the more accurate the
solution becomes. Since there is no exact solution to this problem that can be used to
calculate the error, a Runge-Kutta order five method was run to compare solutions. An
error analysis is provided in the next section. For comparison the following table
contains the results of the Runge-Kutta-Fehlberg method.
Table 2 Summary of Runge-Kutta-Fehlberg Method
Final Step
Size (h)
.00273
.00026
I
T
3,695
37,302
3.88661
3.88522
V
Psi
X
Y
26.77880 -1.20248 46.60284 -56.6233
26.77521 -1.20233 46.58994 -56.5904
Distance
73.3350
73.3014
Looking at the results generated from the Runge-Kutta-Fehlberg method shows that the
final step size is less than the fixed step size of the Runge-Kutta method but the number
of iterations are larger. The reason for this is that the method is checking for a tolerance
and if any one of the variables does not meet the tolerance it re-computes all the variables
again. Obviously this is going to cause an increase in the number of iterations and an
increase in the computational time. However, it does produce much more accurate results
as will be seen in the next section. The reason for this is the error control that is built into
the program. The program constantly verifies that the local truncation error is within the
given tolerance. If this is not the case, it adjusts the step size and recalculates all the
variables. This is looped until the error is acceptable. In the Runge-Kutta methods I
specified step-sizes ranging from 0.1 to 0.001 and I could have decreased the step size
11
even more to increase the accuracy but it would have also increased the number of
iterations and computing time. In the Fehlberg method, it does this guesswork for you.
The program found the optimal step sizes for the given tolerance. With a tolerance of
0.0001, it found the final step size to be .00273 and with a tolerance of 0.00001 it
decreased the final step-size to .00026. It is seen that the step-size is proportional to the
tolerance. Note that only the final step size is shown in these results but a full range of
step sizes were used by the program in order to reach the final approximation. Tabulated
results of the complete runs of these programs can be found in Appendix D.
12
Error Analysis
Table 3 Error Analysis for Runge-Kutta Methods
Method
RK4-x
RK4-y
RK5-x
RK5-y
Error x
Error y
h=0.1
45.74809
-54.50115
46.57445
-56.77442
.17364
2.27327
h=0.01
46.61836
-56.73809
46.61885
-56.69027
.42956
.04782
h=0.001
46.55095
-56.56320
46.59577
-56.60814
.04482
.04494
Table 3 compares the x and y values computed from the Runge-Kutta 4th and 5th
order methods. By simply subtracting the two values you get the error at each time step.
For simplicity I show the error at the final step only. It is clear that as you decrease the
time-step the error in the approximations decreases. It is also clear from this data that the
Runge-Kutta method with step-size of 0.1 is very inaccurate, especially in the y-direction
and will carry over to the overall distance. The level of accuracy is dependant on the
problem and what the user demands.
Table 4 Summary of Errors in Runge-Kutta-Fehlberg Method
Method
RKF
Error X
0.000088926
Error Y
0.000048414
Table 4 illustrates the error in the x and y values when the error control RungeKutta-Fehlberg method is used. Here it is obvious that this method is superior to the
Runge-Kutta methods without error control but you sacrifice computing time and higher
number of iterations when this method is used. Again, use of this is dependant on the
users need of high tolerance. If the user has to pay for this type of computations, the
higher the accuracy means higher cost. There are other numerical approaches to this
problem that control error but are not covered in this report. Some alternative methods
will be discussed in the Conclusions section.
13
Conclusion/Discussion
After completing this project I have learned a lot about initial value problems,
how they are solved, and how they relate to real life. Here I showed how numerical
methods can be used to approximate the distance a skier jumper will jump when certain
initial conditions are known. Of course many things are simplified in this problem to
make the calculations simpler. If this was a real skier with the same initial conditions as
listed above, he would not land at the distances seen in my analysis. Why is that? I very
critical factor was ignored in my analysis, that factor being wind. Wind corrections can
be added to these calculations to obtain even more realistic numbers but increases the
complexity of the formulas. Wind is a complex variable because it changes speed and
direction unexpectedly and is impossible to accurately reproduce the affect of wind
mathematically. Another factor that is not constant although is treated as one is air
density. Air density is based on elevation and also humidity. Since this is a ski jumper
he will be changing altitude several times in one run, which will cause small changes in
the air density but for this problem is can be considered a constant.
Accuracy is always the question when using approximation methods. How
accurate is the solution, and how accurate do I need it to be? There are some problems
that need an incredibly high accuracy. Any type of problem that involves the safety of
humans will require the highest possible accuracy. In the ski-jump problem though, a
high accuracy is unnecessary. This is mainly because the measurement system used to
measure where a skier landed is not highly accurate. The accuracy of the solution is only
good to the accuracy of the measuring equipment. In the solutions I arrived at above, I
have gone above and beyond the level of accuracy needed in such a problem just to prove
a point. In real life this problem may be taken out to the first or second decimal place,
which would be enough accuracy for such a sport. This goes along with my conclusion
of which method is appropriate to use for such a problem. In my opinion the RungeKutta 4th order method is more than enough to arrive at a good approximation. Of course
the right step-size must be used, from my calculations I would recommend a step-size of
0.01 to 0.001. The Fehlberg method will give better results but takes much longer to
compute and that kind of accuracy is not needed for this type of problem.
Other methods could have been used to solve this problem. The Adams Variable
Step Size predictor-Corrector method could have been used. This method is
advantageous because it uses two approximations at each step to approximate the next
successive approximation, unlike the Runge-Kutta-Fehlberg method, which only uses
one. Not only does it use two previous approximations but it also uses both of those
approximations in its error control method. This makes it that much more powerful than
the Fehlberg method. There are many more that do the similar kind of multi-step and
variable step-size methods that can be used to solve this problem to a high level of
accuracy. However, due to time constraints and lack of programming experience they
will not be used in this project.
14
Appendix A- Program Source Code (RK4.f)
RUNGE-KUTTA FOR SYSTEMS OF DIFFERENTIAL EQUATIONS
C
C
C
C
C
C
C
C
C
C
C
TO APPROXIMATE THE SOLUTION OF THE MTH-ORDER SYSTEM OF FIRSTORDER INITIAL-VALUE PROBLEMS
UJ' = FJ(T,U1,U2,...,UM), J=1,2,...,M
A <= T <= B, UJ(A)=ALPHAJ, J=1,2,...,M
AT (N+1) EQUALLY SPACED NUMBERS IN THE INTERVAL [A,B].
INPUT ENDPOINTS A,B; NUMBER OF EQUATIONS M; INTIAL
CONDITIONS ALPHA1,...,ALPHAM; INTEGER N.
OUTPUT APPROXIMATIONS WJ TO UJ(T) AT THE (N+1) VALUES OF T.
CHARACTER NAME1*30,AA*1
INTEGER OUP,FLAG
LOGICAL OK
C
CHANGE FUNCTIONF F1 AND F2 FOR A NEW PROBLEM
F1(T,X1,X2,X3,X4) = -9.81*SIN(X2)-.00899*X1**2
F2(T,X1,X2,X3,X4) = (-9.818*COS(X2)+.00223*X1**2)/X1
F3(T,X1,X2,X3,X4) = X1*COS(X2)
F4(T,X1,X2,X3,X4) = X1*SIN(X2)
C
OPEN(UNIT=5,FILE='CON',ACCESS='SEQUENTIAL')
C
OPEN(UNIT=6,FILE='CON',ACCESS='SEQUENTIAL')
C
DEFINE FUNCTIONS F1,...,FM
WRITE(6,*) 'This is the Runge-Kutta Method for systems with m=4.'
WRITE(6,*) 'Have the functions F1,F2,F3, AND F4 been defined?'
WRITE(6,*) 'Enter Y or N '
WRITE(6,*) ' '
READ(5,*) AA
IF(( AA .EQ. 'Y' ) .OR. ( AA .EQ. 'y' )) THEN
OK = .TRUE.
c10
IF (OK) GOTO 11
c
WRITE(6,*) 'Input left and right endpoints separated by'
c
WRITE(6,*) 'blank'
c
WRITE(6,*) ' '
c
READ(5,*) A, B
c
IF (A.GE.B) THEN
c
WRITE(6,*) 'Left endpoint must be less'
c
WRITE(6,*) 'than right endpoint'
c
ELSE
c
OK = .TRUE.
c
ENDIF
c
GOTO 10
c11
OK = .FALSE.
WRITE(6,*) 'Input the FOUR initial conditions.'
WRITE(6,*) ' '
READ(5,*) ALPHA1, ALPHA2, ALPHA3, ALPHA4
c12
IF (OK) GOTO 13
c
WRITE(6,*) 'Input a positive integer for the number'
c
WRITE(6,*) 'of subintervals '
c
WRITE(6,*) ' '
c
READ(5,*) N
c
IF ( N .LE. 0 ) THEN
c
c
c
c
c
13
6
C
C
C
C
C
C
WRITE(6,*) 'Must be positive integer '
ELSE
OK = .TRUE.
ENDIF
GOTO 12
CONTINUE
ELSE
WRITE(6,*) 'The program will end so that the functions'
WRITE(6,*) 'F1,F2,F3, AND F4 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 METHOD FOR SYSTEMS'
WRITE(OUP,6)
FORMAT(12X,'t(i)',11X,'V(i)',11X,'PSI(i)',11X,'X(i)',11X,'Y(i)')
STEP 1
STEP 2
W1=ALPHA1
W2=ALPHA2
W3=ALPHA3
W4=ALPHA4
STEP 3
WRITE(OUP,1) T,W1,W2,W3,W4
STEP 4
L=1
DO 110 I=1,N
N=L+1
H=.001
T=T+H
STEP 5
X11=H*F1(T,W1,W2,W3,W4)
X12=H*F2(T,W1,W2,W3,W4)
X13=H*F3(T,W1,W2,W3,W4)
X14=H*F4(T,W1,W2,W3,W4)
STEP 6
X21=H*F1(T+H/2,W1+X11/2,W2+X12/2,W3+X13/2,W4+X14/2)
X22=H*F2(T+H/2,W1+X11/2,W2+X12/2,W3+X13/2,W4+X14/2)
X23=H*F3(T+H/2,W1+X11/2,W2+X12/2,W3+X13/2,W4+X14/2)
16
C
C
X24=H*F4(T+H/2,W1+X11/2,W2+X12/2,W3+X13/2,W4+X14/2)
STEP 7
X31=H*F1(T+H/2,W1+X21/2,W2+X22/2,W3+X23/2,W4+X24/2)
X32=H*F2(T+H/2,W1+X21/2,W2+X22/2,W3+X23/2,W4+X24/2)
X33=H*F3(T+H/2,W1+X21/2,W2+X22/2,W3+X23/2,W4+X24/2)
X34=H*F4(T+H/2,W1+X21/2,W2+X22/2,W3+X23/2,W4+X24/2)
STEP 8
X41=H*F1(T+H,W1+X31,W2+X32,W3+X33,W4+X34)
X42=H*F2(T+H,W1+X31,W2+X32,W3+X33,W4+X34)
X43=H*F3(T+H,W1+X31,W2+X32,W3+X33,W4+X34)
X44=H*F4(T+H,W1+X31,W2+X32,W3+X33,W4+X34)
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
W4=W4+(X14+2*X24+2*X34+X44)/6
STEP 10
STEP 11
110
WRITE(OUP,1) T,W1,W2,W3,W4
if ((abs(W4)-abs(W3)).GE.10) then
goto 400
else
goto 110
ENDIF
CONTINUE
C
C
C
C
400
1
STEP 12
write(OUP,*) I
CLOSE(UNIT=5)
CLOSE(UNIT=OUP)
IF(OUP.NE.6) CLOSE(UNIT=6)
STOP
FORMAT(5(1X,E15.8))
END
17
Appendix B- Program Source Code (RK5.c)
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void main()
{
//Constants//
const double hmax = 0.1;
const double vIni = 15;
const double psiIni = 0;
const double xIni = 0;
const double yIni = 0;
const double tIni = 0;
//Variables//
int i = 0;
double h = hmax;
double fv = 0;
double fpsi = 0;
double fx = 0;
double fy = 0;
double t = tIni;
double x = xIni;
double y = yIni;
double v = vIni;
double psi = psiIni;
double psia = psi;
double va = v;
double xa = x;
double ya = y;
double k1v,k1psi,k1x,k1y;
double k2v,k2psi,k2x,k2y;
double k3v,k3psi,k3x,k3y;
double k4v,k4psi,k4x,k4y;
double k5v,k5psi,k5x,k5y;
double k6v,k6psi,k6x,k6y;
double ycheck = 0;
for (;;)
{
//
18
// Check that the condition for continuing the solution is still valid.
//
ycheck = y;
if (ycheck < 0)
ycheck = ycheck*(-1);
if (((ycheck - x)> 10))
break;
//
// Calculate the values of k for the approximation of v, psi, x and y.
//
va = v;
psia = psi;
xa = x;
ya = y;
fv = -9.81*sin(psia)-0.00899*va*va;
fpsi = (-9.81*cos(psia)+0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k1v = h*fv;
k1psi = h*fpsi;
k1x = h*fx;
k1y = h*fy;
va = v + 0.25*k1v;
psia = psi + 0.25*k1psi;
xa = x + 0.25*k1x;
ya = y + 0.25*k1y;
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k2v = h*fv;
k2psi = h*fpsi;
k2x = h*fx;
k2y = h*fy;
va = v + 0.09375*k1v + 0.28125*k2v;
psia = psi + 0.09375*k1psi + 0.28125*k2psi;
xa = x + 0.09375*k1x + 0.28125*k2x;
ya = y + 0.09375*k1y + 0.28125*k2y;
19
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k3v = h*fv;
k3psi = h*fpsi;
k3x = h*fx;
k3y = h*fy;
va = v + 0.879380974056*k1v - 3.2771961766*k2v +
3.32089212563*k3v;
psia = psi + 0.879380974056*k1psi - 3.2771961766*k2psi + 3.32089212563*k3psi;
xa = x + 0.879380974056*k1x - 3.2771961766*k2x +
3.32089212563*k3x;
ya = y + 0.879380974056*k1y - 3.2771961766*k2y +
3.32089212563*k3y;
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k4v = h*fv;
k4psi = h*fpsi;
k4x = h*fx;
k4y = h*fy;
va = v + 2.03240740741*k1v - 8*k2v + 7.17348927875*k3v - 0.20589668616*k4v;
psia = psia + 2.03240740741*k1psi - 8*k2psi + 7.17348927875*k3psi 0.20589668616*k4psi;
xa = xa + 2.03240740741*k1x - 8*k2x + 7.17348927875*k3x - 0.20589668616*k4x;
ya = ya + 2.03240740741*k1y - 8*k2y + 7.17348927875*k3y - 0.20589668616*k4y;
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k5v = h*fv;
k5psi = h*fpsi;
k5x = h*fx;
k5y = h*fy;
va = v - 0.296296296296*k1v + 2*k2v - 1.38167641326*k3v + 0.452972709552*k4v 0.275*k5v;
20
psia = psi - 0.296296296296*k1psi + 2*k2psi - 1.38167641326*k3psi +
0.452972709552*k4psi - 0.275*k5psi;
xa = x - 0.296296296296*k1x + 2*k2x - 1.38167641326*k3x + 0.452972709552*k4x 0.275*k5x;
ya = y - 0.296296296296*k1y + 2*k2y - 1.38167641326*k3y + 0.452972709552*k4y 0.275*k5y;
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k6v = h*fv;
k6psi = h*fpsi;
k6x = h*fx;
k6y = h*fy;
t = t + h;
v = v + 0.118518518519*k1v + 0.518986354776*k3v + 0.506131490342*k4v 0.18*k5v + 0.0363636363636*k6v;
psi = psi + 0.118518518519*k1psi + 0.518986354776*k3psi + 0.506131490342*k4psi 0.18*k5psi + 0.0363636363636*k6psi;
x = x + 0.118518518519*k1x + 0.518986354776*k3x + 0.506131490342*k4x 0.18*k5x + 0.0363636363636*k6x;
y = y + 0.118518518519*k1y + 0.518986354776*k3y + 0.506131490342*k4y 0.18*k5y + 0.0363636363636*k6y;
i += 1;
printf("%d %7.5f
\n",i,t,v,psi,x,y);
}
}
%7.5f
21
%7.5f
%7.5f
%7.5f
Appendix C- Program Source Code (RKF.c)
{
//Constants// This is where all the constants and initial conditions are declared.
const double hmax = 0.01;
const double hmin = 0.0001;
const double vIni = 15;
const double psiIni = 0;
const double xIni = 0;
const double yIni = 0;
const double tIni = 0;
const double TOL = 0.0001;
//Variables// This is where all the variables in the problem are defined.
int i = 0;
double h = hmax;
double fv = 0;
double fpsi = 0;
double fx = 0;
double fy = 0;
double t = tIni;
double x = xIni;
double y = yIni;
double v = vIni;
double psi = psiIni;
double psia = psi;
double va = v;
double xa = x;
double ya = y;
double k1v,k1psi,k1x,k1y;
double k2v,k2psi,k2x,k2y;
double k3v,k3psi,k3x,k3y;
double k4v,k4psi,k4x,k4y;
double k5v,k5psi,k5x,k5y;
double k6v,k6psi,k6x,k6y;
double Rv,Rpsi,Rx,Ry,R;
double delta = 0;
double ycheck = 0;
for (;;) This is the beginning of the loop that will continue calculating the variables
until the predefined tolerance is met.
{
//
// The method to determine when the calculation can stop.
22
//
ycheck = y;
if (ycheck < 0)
ycheck = ycheck*(-1);
if (((ycheck - x)> 10))
break;
//
// The formulas to calculate the K values that are used to approximate
the variables..
//
va = v;
psia = psi;
xa = x;
ya = y;
fv = -9.81*sin(psia)-0.00899*va*va;
fpsi = (-9.81*cos(psia)+0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k1v = h*fv;
k1psi = h*fpsi;
k1x = h*fx;
k1y = h*fy;
va = v + 0.25*k1v;
psia = psi + 0.25*k1psi;
xa = x + 0.25*k1x;
ya = y + 0.25*k1y;
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k2v = h*fv;
k2psi = h*fpsi;
k2x = h*fx;
k2y = h*fy;
va = v + 0.09375*k1v + 0.28125*k2v;
psia = psi + 0.09375*k1psi + 0.28125*k2psi;
xa = x + 0.09375*k1x + 0.28125*k2x;
ya = y + 0.09375*k1y + 0.28125*k2y;
23
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k3v = h*fv;
k3psi = h*fpsi;
k3x = h*fx;
k3y = h*fy;
va = v + 0.879380974056*k1v - 3.2771961766*k2v + .32089212563*k3v;
psia = psi + 0.879380974056*k1psi - 3.2771961766*k2psi +
3.32089212563*k3psi;
xa = x + 0.879380974056*k1x - 3.2771961766*k2x + 3.32089212563*k3x;
ya = y + 0.879380974056*k1y - 3.2771961766*k2y + 3.32089212563*k3y;
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k4v = h*fv;
k4psi = h*fpsi;
k4x = h*fx;
k4y = h*fy;
va = v + 2.03240740741*k1v - 8*k2v + 7.17348927875*k3v 0.20589668616*k4v;
psia = psia + 2.03240740741*k1psi - 8*k2psi + 7.17348927875*k3psi 0.20589668616*k4psi;
xa = xa + 2.03240740741*k1x - 8*k2x + 7.17348927875*k3x 0.20589668616*k4x;
ya = ya + 2.03240740741*k1y - 8*k2y + 7.17348927875*k3y 0.20589668616*k4y;
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k5v = h*fv;
k5psi = h*fpsi;
k5x = h*fx;
k5y = h*fy;
24
va = v - 0.296296296296*k1v + 2*k2v - 1.38167641326*k3v +
0.452972709552*k4v - 0.275*k5v;
psia = psi - 0.296296296296*k1psi + 2*k2psi - 1.38167641326*k3psi +
0.452972709552*k4psi - 0.275*k5psi;
xa = x - 0.296296296296*k1x + 2*k2x - 1.38167641326*k3x +
0.452972709552*k4x - 0.275*k5x;
ya = y - 0.296296296296*k1y + 2*k2y - 1.38167641326*k3y +
0.452972709552*k4y - 0.275*k5y;
fv = -9.81*sin(psia) - 0.00899*va*va;
fpsi = (-9.81*cos(psia)+ 0.00223*va*va)/va;
fx = va*cos(psia);
fy = va*sin(psia);
k6v = h*fv;
k6psi = h*fpsi;
k6x = h*fx;
k6y = h*fy;
//
// To Calculate the values of error for v, psi, x, y and check if the
// tolerance condition was met by each error value.
//
Rv = (1/h)*(0.00277777777778*k1v - 0.0299415204678*k3v 0.0291998936736*k4v + 0.02*k5v + 0.0363636363636*k6v);
if (Rv < 0)
Rv = Rv*(-1);
Rpsi = (1/h)*(0.00277777777778*k1psi - 0.0299415204678*k3psi 0.0291998936736*k4psi +0.02*k5psi + 0.0363636363636*k6psi);
if (Rpsi < 0)
Rpsi = Rpsi*(-1);
Rx = (1/h)*(0.00277777777778*k1x - 0.0299415204678*k3x 0.0291998936736*k4x + 0.02*k5x + 0.0363636363636*k6x);
if (Rx < 0)
Rx = Rx*(-1);
Ry = (1/h)*(0.00277777777778*k1y - 0.0299415204678*k3y 0.0291998936736*k4y + 0.02*k5y + 0.0363636363636*k6y);
if (Ry < 0)
Ry = Ry*(-1);
if ((Rv <= TOL) && (Rpsi <= TOL) && (Rx <= TOL) && (Ry <= TOL))
{
//
// Approximation was acceptable and so calculate approximation for v,psi,
// x and y. Increase the value of t and increment the counter i.
25
// output the calculated results.
//
t = t + h;
v = v + 0.115740740741*k1v + 0.548927875244*k3v + 0.535331384016*k4v 0.2*k5v;
psi = psi + 0.115740740741*k1psi + 0.548927875244*k3psi +
0.535331384016*k4psi - 0.2*k5psi;
x = x + 0.115740740741*k1x + 0.548927875244*k3x
+
0.535331384016*k4x - 0.2*k5x;
y = y + 0.115740740741*k1y + 0.548927875244*k3y
+
0.535331384016*k4y - 0.2*k5y;
i += 1;
printf("%d %7.5f %7.5f %7.5f %7.5f %7.5 %7.5f %7.9f
%7.9f %7.9f \n",i,t,h,v,psi,x,y,Rv,Rpsi,Rx,Ry);
h = hmax;
}
else
{
//
// The error condition was not met and so change the step size h.
//
// Set R to the highest value of error calculated for the approximations
// of v, psi, x and y.
//
if ((Rv > TOL) && (Rv > Rpsi) && (Rv > Rx) && (Rv > Ry))
R = Rv;
else
{
if ((Rpsi > TOL) && (Rpsi > Rv)&& (Rpsi > Rx) && (Rpsi > Ry))
R = Rpsi;
else
{
if ((Rx > TOL) && (Rx > Rpsi) && (Rx > Rv) && (Rx > Ry))
R = Rx;
else
R = Ry;
}
}
//
// Calculate the correction value to the step size h and set the new
// step size h.
//
delta = 0.84*sqrt(sqrt(TOL/R));
26
%7.9f
if (delta <=0.1)
h = 0.1*h;
else
if (delta >=4)
h = 4*h;
else
h = delta*h;
if (h > hmax)
h = hmax;
if (h < hmin)
h = hmin;
}
}
}
27
Appendix D- Tabulated Results of all Programs
Table 5 Runge-Kutta 4th Order h=0.1
Iteration (i)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
T(i)
0.00000
0.10000
0.20000
0.30000
0.40000
0.50000
0.60000
0.70000
0.80000
0.90000
1.00000
1.10000
1.20000
1.30000
1.40000
1.50000
1.60000
1.70000
1.80000
1.90000
2.00000
2.10000
2.20000
2.30000
2.40000
2.50000
2.60000
2.70000
2.80000
2.90000
3.00000
3.10000
3.20000
3.30000
3.40000
3.50000
3.60000
3.70000
3.80000
V(i)
15
14.83073
14.72649
14.68529
14.70446
14.78068
14.91011
15.08849
15.31129
15.57383
15.87143
16.19950
16.55360
16.92954
17.32341
17.73160
18.15078
18.57795
19.01041
19.44574
19.88178
20.31664
20.74863
21.17629
21.59837
22.01378
22.42157
22.82098
23.21135
23.59214
23.96293
24.32339
24.67326
25.01239
25.34066
25.65803
25.96451
26.26016
26.54506
Psi(i)
0
-0.06248
-0.12534
-0.18802
-0.24997
-0.31069
-0.36973
-0.42673
-0.48139
-0.53351
-0.58297
-0.62971
-0.67372
-0.71505
-0.75378
-0.79001
-0.82386
-0.85545
-0.88494
-0.91244
-0.93809
-0.96201
-0.98434
-1.00517
-1.02462
-1.04279
-1.05977
-1.07565
-1.09051
-1.10441
-1.11743
-1.12963
-1.14107
-1.15180
-1.16187
-1.17133
-1.18021
-1.18855
-1.19640
28
X(i)
0
1.49002
2.96060
4.41243
5.84608
7.26207
8.66082
10.04269
11.40800
12.75702
14.08997
15.40707
16.70852
17.99448
19.26514
20.52067
21.76124
22.98705
24.19827
25.39512
26.57780
27.74654
28.90157
30.04315
31.17152
32.28697
33.38977
34.48021
35.55859
36.62521
37.68039
38.72444
39.75768
40.78042
41.79300
42.79574
43.78895
44.77296
45.74809
Y(i)
0
-0.04640
-0.18484
-0.41423
-0.73344
-1.14135
-1.63678
-2.21854
-2.88536
-3.63595
-4.46895
-5.38294
-6.37646
-7.44798
-8.59591
-9.81865
-11.11451
-12.48177
-13.91870
-15.42351
-16.99440
-18.62955
-20.32712
-22.08526
-23.90214
-25.77589
-27.70469
-29.68671
-31.72012
-33.80315
-35.93403
-38.11101
-40.33238
-42.59645
-44.90159
-47.24618
-49.62865
-52.04747
-54.50115
Table 6 Runge-Kutta 4th Order h=0.01
Iteration (i)
1
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360
370
380
389
T(i)
0.00000
0.09000
0.19000
0.29000
0.39000
0.49000
0.59000
0.69000
0.79000
0.89000
0.99000
1.09000
1.19000
1.29000
1.39000
1.49000
1.59000
1.69000
1.79000
1.89000
1.99000
2.09000
2.19000
2.29000
2.39000
2.49000
2.59000
2.69000
2.79000
2.89000
2.99000
3.09000
3.19000
3.29000
3.39000
3.49000
3.59000
3.69000
3.79000
3.89000
V(i)
15.00000
14.84470
14.73404
14.68665
14.69992
14.77060
14.89489
15.06858
15.28714
15.54592
15.84023
16.16545
16.51714
16.89108
17.28333
17.69023
18.10845
18.53495
18.96700
19.40215
19.83821
20.27326
20.70561
21.13377
21.55646
21.97257
22.38117
22.78144
23.17274
23.55451
23.92632
24.28782
24.63877
24.97897
25.30833
25.62679
25.93436
26.23108
26.51706
26.79240
Psi(i)
0.00000
-0.05621
-0.11905
-0.18178
-0.24382
-0.30469
-0.36391
-0.42113
-0.47603
-0.52842
-0.57815
-0.62516
-0.66944
-0.71104
-0.75002
-0.78649
-0.82057
-0.85239
-0.88208
-0.90977
-0.93560
-0.95970
-0.98217
-1.00315
-1.02274
-1.04103
-1.05813
-1.07411
-1.08906
-1.10306
-1.11617
-1.12845
-1.13996
-1.15076
-1.16089
-1.17041
-1.17934
-1.18774
-1.19563
-1.20306
29
X(i)
0.00000
1.34191
2.81440
4.26807
5.70352
7.12125
8.52171
9.90526
11.27221
12.62284
13.95739
15.27607
16.57907
17.86657
19.13875
20.39579
21.63785
22.86513
24.07781
25.27608
26.46017
27.63029
28.78669
29.92959
31.05928
32.17600
33.28005
34.37171
35.45128
36.51907
37.57538
38.62053
39.65483
40.67861
41.69220
42.69590
43.69005
44.67496
45.65096
46.61836
Y(i)
0.00000
-0.03760
-0.16689
-0.38723
-0.69751
-1.09660
-1.58334
-2.15651
-2.81489
-3.55716
-4.38198
-5.28794
-6.27357
-7.33736
-8.47773
-9.69306
-10.98168
-12.34189
-13.77193
-15.27004
-16.83440
-18.46321
-20.15462
-21.90679
-23.71788
-25.58603
-27.50940
-29.48618
-31.51454
-33.59269
-35.71886
-37.89130
-40.10831
-42.36819
-44.66929
-47.01001
-49.38876
-51.80402
-54.25428
-56.73809
Table 7 Runge-Kutta 4th Order h=0.001
Iteration (i)
0
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
2200
2300
2400
2500
2600
2700
2800
2900
3000
3100
3200
3300
3400
3500
3600
3700
3800
3883
T(i)
0.00000
0.09900
0.19900
0.29900
0.39900
0.49900
0.60000
0.70099
0.80099
0.90099
0.90199
1.00099
1.10000
1.20000
1.30000
1.40001
1.50001
1.60002
1.70002
1.80003
1.90003
2.00004
2.10003
2.20002
2.30002
2.40001
2.50000
2.59999
2.69999
2.79998
2.89997
2.99997
3.19995
3.29994
3.39994
3.49993
3.59992
3.69991
3.79991
3.88290
V(i)
15.00000
14.83209
14.72721
14.68540
14.70397
14.77964
14.91010
15.09049
15.31371
15.57663
15.57945
15.87457
16.19949
16.55360
16.92955
17.32342
17.73160
18.15079
18.57796
19.01042
19.44575
19.88181
20.31666
20.74865
21.17631
21.59839
22.01379
22.42159
22.82100
23.21137
23.59216
23.96295
24.67329
25.01241
25.34069
25.65806
25.96454
26.26018
26.54508
26.77348
Psi(i)
0.00000
-0.06185
-0.12471
-0.18740
-0.24936
-0.31009
-0.36973
-0.42729
-0.48192
-0.53402
-0.53453
-0.58345
-0.62971
-0.67372
-0.71505
-0.75378
-0.79001
-0.82385
-0.85545
-0.88494
-0.91244
-0.93809
-0.96201
-0.98434
-1.00517
-1.02462
-1.04279
-1.05978
-1.07565
-1.09051
-1.10441
-1.11743
-1.14107
-1.15180
-1.16187
-1.17133
-1.18021
-1.18855
-1.19640
-1.20255
30
X(i)
0.00000
1.47522
2.94599
4.39800
5.83183
7.24799
8.66082
10.05642
11.42157
12.77042
12.78383
14.10321
15.40706
16.70850
17.99447
19.26512
20.52065
21.76122
22.98703
24.19826
25.39512
26.57780
27.74654
28.90158
30.04315
31.17153
32.28699
33.38980
34.48023
35.55861
36.62524
37.68042
39.75769
40.78045
41.79303
42.79577
43.78898
44.77299
45.74811
46.55095
Y(i)
0.00000
-0.04547
-0.18300
-0.41149
-0.72981
-1.13684
-1.63678
-2.22479
-2.89246
-3.64388
-3.65181
-4.47769
-5.38294
-6.37646
-7.44798
-8.59591
-9.81865
-11.11450
-12.48177
-13.91870
-15.42351
-16.99440
-18.62955
-20.32711
-22.08526
-23.90214
-25.77590
-27.70470
-29.68672
-31.72014
-33.80317
-35.93406
-40.33241
-42.59649
-44.90163
-47.24622
-49.62871
-52.04753
-54.50121
-56.56320
Table 8 Runge-Kutta 5th Order h=0.1
Iteration (i)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
T(i)
0.10
0.20
0.30
0.40
0.50
0.60
0.70
0.80
0.90
1.00
1.10
1.20
1.30
1.40
1.50
1.60
1.70
1.80
1.90
2.00
2.10
2.20
2.30
2.40
2.50
2.60
2.70
2.80
2.90
3.00
3.10
3.20
3.30
3.40
3.50
3.60
3.70
3.80
3.90
V(i)
14.82060
14.70654
14.65603
14.66659
14.73505
14.85769
15.03032
15.24843
15.50732
15.80227
16.12861
16.48181
16.85760
17.25196
17.66117
18.08185
18.51089
18.94553
19.38326
19.82188
20.25945
20.69423
21.12473
21.54967
21.96791
22.37852
22.78069
23.17376
23.55718
23.93051
24.29342
24.64566
24.98704
25.31747
25.63690
25.94534
26.24284
26.52949
26.80544
Psi(i)
-0.06249
-0.12546
-0.18832
-0.25054
-0.31159
-0.37101
-0.42842
-0.48350
-0.53604
-0.58589
-0.63300
-0.67735
-0.71898
-0.75796
-0.79441
-0.82844
-0.86019
-0.88978
-0.91737
-0.94308
-0.96704
-0.98937
-1.01020
-1.02963
-1.04777
-1.06470
-1.08053
-1.09532
-1.10915
-1.12210
-1.13422
-1.14557
-1.15622
-1.16620
-1.17556
-1.18435
-1.19260
-1.20036
-1.20764
31
X(i)
1.49137
2.96325
4.41634
5.85119
7.26827
8.66795
10.05055
11.41632
12.76548
14.09823
15.41474
16.71516
17.99968
19.26844
20.52163
21.75942
22.98202
24.18962
25.38244
26.56073
27.72473
28.87469
30.01090
31.13363
32.24318
33.33986
34.42398
35.49587
36.55584
37.60423
38.64138
39.66763
40.68331
41.68876
42.68433
43.67035
44.64716
45.61508
46.57445
Y(i)
-0.03106
-0.15425
-0.36861
-0.67315
-1.06686
-1.54868
-2.11748
-2.77207
-3.51118
-4.33348
-5.23756
-6.22195
-7.28509
-8.42539
-9.64120
-10.93079
-12.29243
-13.72433
-15.22468
-16.79164
-18.42335
-20.11794
-21.87353
-23.68825
-25.56023
-27.48760
-29.46850
-31.50111
-33.58360
-35.71420
-37.89113
-40.11266
-42.37710
-44.68279
-47.02810
-49.41144
-51.83127
-54.28608
-56.77442
Table 9 Runge-Kutta 5th Order h=0.01
Iteration (i)
0
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
260
270
280
290
300
310
320
330
340
350
360
370
380
389
T(i)
0.00
0.10
0.20
0.30
0.40
0.50
0.60
0.70
0.80
0.90
1.00
1.10
1.20
1.30
1.40
1.50
1.60
1.70
1.80
1.90
2.00
2.10
2.20
2.30
2.40
2.60
2.70
2.80
2.90
3.00
3.10
3.20
3.30
3.40
3.50
3.60
3.70
3.80
3.89
V(i)
14.98000
14.82970
14.72442
14.68218
14.70033
14.77559
14.90412
15.08169
15.30376
15.56567
15.86274
16.19037
16.54412
16.91980
17.31348
17.72155
18.14067
18.56785
19.00036
19.43578
19.87195
20.30696
20.73913
21.16700
21.58930
22.41298
22.81264
23.20327
23.58432
23.95538
24.31610
24.66624
25.00563
25.33415
25.65178
25.95851
26.25439
26.53953
26.78707
Psi(i)
-0.00621
-0.06243
-0.12525
-0.18790
-0.24983
-0.31054
-0.36958
-0.42658
-0.48126
-0.53340
-0.58288
-0.62963
-0.67366
-0.71501
-0.75376
-0.79000
-0.82386
-0.85548
-0.88497
-0.91248
-0.93814
-0.96207
-0.98440
-1.00524
-1.02469
-1.05985
-1.07572
-1.09058
-1.10448
-1.11750
-1.12970
-1.14113
-1.15186
-1.16193
-1.17138
-1.18026
-1.18860
-1.19644
-1.20310
32
X(i)
0.14990
1.49004
2.96063
4.41247
5.84616
7.26218
8.66098
10.04291
11.40828
12.75736
14.09038
15.40755
16.70905
17.99507
19.26578
20.52135
21.76196
22.98779
24.19903
25.39589
26.57857
27.74730
28.90233
30.04389
31.17224
33.39044
34.48085
35.55921
36.62580
37.68095
38.72498
39.75819
40.78092
41.79349
42.79621
43.78942
44.77343
45.74856
46.61885
Y(i)
-0.00031
-0.04481
-0.18161
-0.40929
-0.72677
-1.13292
-1.62660
-2.20660
-2.87168
-3.62056
-4.45187
-5.36422
-6.35614
-7.42609
-8.57252
-9.79379
-11.08822
-12.45411
-13.88971
-15.39324
-16.96290
-18.59685
-20.29327
-22.05031
-23.86611
-27.66665
-29.64772
-31.68022
-33.76238
-35.89241
-38.06858
-40.28917
-42.55250
-44.85692
-47.20082
-49.58263
-52.00082
-54.45389
-56.69027
Table 10 Runge-Kutta 5th Order h=0.001
Iteration (i)
0
100
200
400
500
600
700
800
900
1000
1100
1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
2200
2300
2400
2500
2600
2700
2800
2900
3000
3100
3200
3300
3400
3500
3600
3700
3800
3886
T(i)
0.00
0.10
0.20
0.40
0.50
0.60
0.70
0.80
0.90
1.00
1.10
1.20
1.30
1.40
1.50
1.60
1.70
1.80
1.90
2.00
2.10
2.20
2.30
2.40
2.50
2.60
2.70
2.80
2.90
3.00
3.10
3.20
3.30
3.40
3.50
3.60
3.70
3.80
3.89
V(i)
15.00000
14.83060
14.72619
14.70369
14.77963
14.90876
15.08683
15.30931
15.57153
15.86883
16.19659
16.55041
16.92609
17.31972
17.72767
18.14665
18.57365
19.00596
19.44115
19.87708
20.31184
20.74375
21.17136
21.59340
22.00878
22.41656
22.81597
23.20635
23.58717
23.95799
24.31849
24.66842
25.00760
25.33594
25.65338
25.95993
26.25565
26.54064
26.77723
Psi(i)
0.00000
-0.06243
-0.12524
-0.24977
-0.31045
-0.36945
-0.42641
-0.48105
-0.53315
-0.58259
-0.62931
-0.67331
-0.71463
-0.75335
-0.78958
-0.82342
-0.85502
-0.88450
-0.91201
-0.93766
-0.96159
-0.98392
-1.00475
-1.02421
-1.04238
-1.05937
-1.07525
-1.09011
-1.10402
-1.11705
-1.12925
-1.14070
-1.15143
-1.16151
-1.17097
-1.17985
-1.18820
-1.19605
-1.20243
33
X(i)
0.00000
1.49002
2.96061
5.84613
7.26216
8.66098
10.04294
11.40836
12.75752
14.09065
15.40795
16.70963
17.99585
19.26681
20.52266
21.76359
22.98978
24.20141
25.39869
26.58184
27.75106
28.90660
30.04871
31.17763
32.29365
33.39704
34.48808
35.56708
36.63434
37.69017
38.73488
39.76879
40.79222
41.80549
42.80892
43.80284
44.78756
45.76341
46.59577
Y(i)
0.00000
-0.04620
-0.18437
-0.73222
-1.13964
-1.63453
-2.21569
-2.88186
-3.63175
-4.46401
-5.37723
-6.36994
-7.44062
-8.58770
-9.80956
-11.10452
-12.47088
-13.90689
-15.41077
-16.98073
-18.61495
-20.31159
-22.06880
-23.88475
-25.75758
-27.68547
-29.66658
-31.69910
-33.78125
-35.91125
-38.08736
-40.30788
-42.57112
-44.87544
-47.21922
-49.60089
-52.01893
-54.47185
-56.60814
Table 11 Rung-Kutta-Fehlberg (hmin=0.00001, hmax=0.01,TOL=0.00001)
Iteration (i)
1
2
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
37288
37289
37290
37291
37292
37293
37294
37295
37296
37297
37298
37299
37300
37301
37302
T(i)
0.00005
0.0001
0.26355
0.2636
0.26366
0.26371
0.26376
0.26382
0.26387
0.26392
0.26398
0.26403
0.26408
0.26414
0.26419
0.26424
0.2643
3.88156
3.88182
3.88208
3.88234
3.8826
3.88287
3.88313
3.88339
3.88365
3.88391
3.88417
3.88444
3.8847
3.88496
3.88522
V(i)
14.99989
14.99979
14.69297
14.69296
14.69294
14.69292
14.6929
14.69289
14.69287
14.69285
14.69283
14.69282
14.6928
14.69278
14.69276
14.69275
14.69273
26.76529
26.766
26.76671
26.76742
26.76813
26.76884
26.76954
26.77025
26.77096
26.77167
26.77238
26.77309
26.7738
26.77451
26.77521
Psi(i)
-0.00003
-0.00006
-0.16509
-0.16512
-0.16516
-0.16519
-0.16522
-0.16526
-0.16529
-0.16532
-0.16536
-0.16539
-0.16542
-0.16546
-0.16549
-0.16552
-0.16556
-1.20207
-1.20209
-1.20211
-1.20213
-1.20215
-1.20216
-1.20218
-1.2022
-1.20222
-1.20224
-1.20226
-1.20228
-1.2023
-1.20232
-1.20233
34
X(i)
0.00078
0.00156
3.88539
3.88616
3.88693
3.88771
3.88848
3.88925
3.89002
3.89079
3.89156
3.89234
3.89311
3.89388
3.89465
3.89542
3.89619
46.55461
46.55713
46.55965
46.56218
46.5647
46.56722
46.56975
46.57227
46.57479
46.57732
46.57984
46.58237
46.58489
46.58742
46.58994
Y(i)
-8E-09
-4.1E-08
-0.31986
-0.31999
-0.32011
-0.32024
-0.32037
-0.3205
-0.32063
-0.32076
-0.32089
-0.32102
-0.32114
-0.32127
-0.3214
-0.32153
-0.32166
-56.499
-56.5055
-56.512
-56.5186
-56.5251
-56.5316
-56.5382
-56.5447
-56.5512
-56.5578
-56.5643
-56.5708
-56.5774
-56.5839
-56.5904
Table 5 Rung-Kutta-Fehlberg (hmin=0.0001, hmax=0.01,TOL=0.0001)
Iteration (i)
1
2
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
T(i)
0.00054
0.00109
0.77901
0.77967
0.78033
0.78099
0.78166
0.78232
0.78298
0.78365
0.78431
0.78498
0.78564
0.78630
0.78697
0.78763
0.78830
3.84868
3.85137
3.85407
3.85677
3.85947
3.86217
3.86488
3.86759
3.87030
3.87301
3.87573
3.87844
3.88117
3.88389
3.88661
V(i)
14.99890
14.99780
15.25936
15.26092
15.26248
15.26404
15.26560
15.26716
15.26873
15.27030
15.27187
15.27344
15.27502
15.27660
15.27818
15.27976
15.28135
26.67543
26.68282
26.69021
26.69760
26.70499
26.71237
26.71976
26.72714
26.73453
26.74191
26.74929
26.75667
26.76405
26.77143
26.77880
Psi(i)
-0.00034
-0.00068
-0.46978
-0.47013
-0.47049
-0.47085
-0.4712
-0.47156
-0.47192
-0.47227
-0.47263
-0.47299
-0.47335
-0.4737
-0.47406
-0.47442
-0.47477
-1.19971
-1.19991
-1.20011
-1.20031
-1.20050
-1.20070
-1.20090
-1.20110
-1.20130
-1.20149
-1.20169
-1.20189
-1.20209
-1.20228
-1.20248
35
X(i)
0.00816
0.01632
11.1231
11.13211
11.14113
11.15014
11.15916
11.16818
11.1772
11.18622
11.19525
11.20428
11.21331
11.22234
11.23138
11.24042
11.24945
46.23647
46.26253
46.2886
46.31469
46.3408
46.36693
46.39307
46.41924
46.44541
46.47161
46.49782
46.52405
46.55030
46.57656
46.60284
Y(i)
-8.7E-07
-4.5E-06
-2.73542
-2.74000
-2.74458
-2.74916
-2.75376
-2.75835
-2.76295
-2.76756
-2.77217
-2.77679
-2.78141
-2.78604
-2.79067
-2.79531
-2.79996
-55.6779
-55.7449
-55.8120
-55.8791
-55.9464
-56.0137
-56.0811
-56.1486
-56.2161
-56.2838
-56.3515
-56.4193
-56.4872
-56.5552
-56.6233
Table 12 Runge-Kutta-Fehlberg Error for TOL=.00001
Iteration (i)
1
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
2200
2300
2400
2500
2600
2700
2800
2900
3000
3100
Rv
0.000061168
0.000061573
0.000061879
0.00006208
0.000062173
0.000062157
0.000062031
0.000061792
0.000061448
0.000060991
0.000060424
0.000059748
0.000058966
0.000058079
0.000057091
0.000056003
0.00005482
0.000053546
0.000052183
0.000050738
0.000049214
0.000056289
0.00005341
0.00004776
0.00004283
0.000038499
0.00003467
0.00003127
0.000028239
0.000025527
0.000023094
0.000020906
Rpsi
0.000000001
0.00000014
0.000000284
0.000000432
0.000000582
0.000000733
0.000000885
0.000001038
0.000001185
0.000001331
0.000001474
0.000001611
0.000001743
0.000001867
0.000001984
0.000002093
0.000002192
0.000002281
0.00000236
0.000002428
0.000002486
0.00000301
0.000003025
0.000002852
0.000002683
0.000002519
0.000002362
0.000002212
0.00000207
0.000001935
0.000001808
0.000001688
36
Rx
0.000000063
0.000003202
0.0000064
0.000009625
0.000012881
0.000016169
0.000019492
0.000022885
0.000026251
0.000029695
0.000033185
0.000036726
0.000040322
0.000043979
0.000047701
0.000051494
0.000055367
0.000059325
0.000063378
0.000067535
0.000071806
0.00009106
0.000096535
0.000096208
0.000095718
0.000095085
0.000094325
0.00009345
0.000092468
0.000091385
0.000090204
0.000088926
Ry
0.000093516
0.000093511
0.000093465
0.000093376
0.000093243
0.000093066
0.000092843
0.000092571
0.000092259
0.000091895
0.000091483
0.00009102
0.000090507
0.000089942
0.000089324
0.000088651
0.000087923
0.000087136
0.000086289
0.000085381
0.000084408
0.000098791
0.000096271
0.000088513
0.000081633
0.000075471
0.000069907
0.000064848
0.000060222
0.000055971
0.000052048
0.000048414
References
1. Burden, R.L. and Faires, J.D. Numerical Analysis 7th edition. Brooks/Cole. 2001
273-324.
2. de Mestre, Neville. The Mathematics of Projectiles in Sport. 106-111, 158-161.
3. Kazmierczak, Anna. Trajectories of Skiers in Nordic Jumping. 42-55, 1999.
37
Download