You are on page 1of 8

Projectile Motion Using Runge-Kutta Methods

Kamalu J. Beamer
April 2, 2013

Introduction

An objects trajectory through a medium is an important phenomenon that


has many applications in physics. These trajectories are defined by differential
equations. There are many ways to evolve dynamical systems through the evolution of their differential equations. Using the 4th order Runge-Kutta method,
a program was developed to calculate the trajectory of a baseballs precession
through the air. The simulations were done with different constraint conditions.
Data sets were produced for one drag-free environment, two environments with
different altitudes and drag forces, and two environments with different altitudes, drag forces and with either head or tail wind. It was determined that a
450 home run launch angle was optimal in the vacuum (drag-free) while a 400
home run launch angle was optimal in all environments with drag force. It was
also determined that at higher altitudes, drag forces are exponentially reduced.
The applied drag forces are described in the Theory section and the two
environments with different altitudes were NY (altitude = 0 m) and Denver
(altitude = 1600 m). After the program was designed to accomodate for drag
forces as functions of altitude, additional head and tail winds were applied.
Simulations were done in both environments, each with a head and then a tail
wind of 15 mph = 6.7056 m
s .

Theory

A baseballs flight through the air is only an interesting case if drag forces
are applicable. A baseballs flight through a vacuum follows simple parabolic
motion, as is seen in Figure 3; the red line represents the no drag case. Figure
1 [4] is a free-body diagram of a baseball in flight; velocity is not a force, the
arrow is to indicate the direction of the velocity. In the drag free case, gravity
is the only force affecting the ball, therefore the velocity is constant throughout
the entire flight of the ball. With only gravitational force, the baseball follows
simple parabolic motion. These phenomena are resultant of Newtons Laws [4],
most importantly the Law 1 an object continues in its initial state of rest or
motion with uniform velocity unless it is acted on by an unbalanced, or net
external force. [4].
1

Figure 1: A baseballs precession through the air with an initial velocity, and
two applied forces.
With the introduction of drag force, the dynamical system acts significantly
different. The effect of air resistance is important for ... a high flying baseball
hit deep to the outfield [2]; the air resistance or drag force is opposite the
projectiles velocity. The Prandtl expression for the motion of a particle in a
medium in which there is a resisting force proportional to the speed or two the
square of the speed [2] is as follows.
Fdrag = 21 Cw Av2
In the previous equation Cw is drag coefficient, A is the cross-sectional area
of the object, is the air density, v is the velocity of the object. All values
relative to the lab are given in Table 1 [1]. The final drag force is an additional
force applied to the baseball during its flight. One further modification must
be made to the previous equation before we can apply it to the baseball. We
are also interested in observing a baseballs trajectory at different altitudes, yet
there is no height dependence in the previous equation. To remedy, we equate
= 0 exph/h0 [1] with h as the altitude and h0 (scale height) as a constant
found in Table 1.
Baseball Mass
Baseball Area
Drag Coeff (Cw )
Air Density (0 )
Typical HR Velocity
Scale Height (h0 )

0.145 kg
0.0043 m2
0.35
kg
1.22 m
3
49.0 m
s
7000 m

Table 1 - Input values of trajectory-calculating program.


With the revised drag force, all applicable forces were cast on the baseball
in flight. The following equation is the final form of Newtons force law applied
to the baseball.
Ftotal = Fgrav + Fdrag
Since both forces are in the opposite direction of the baseballs initial velocity,
they are both considered negative. With this characterization, we obtain the
following.
2

1
2
h/h0
m dv
,
dt = -mg - 2 Cw Av 0 exp

dx
dt

=v

Evidently, these are the equations of motion converted to the form utilizable by RK4 [1]. The 4th order Runge-Kutta method is a more stable version of the 2nd order Runge-Kutta method which was not applied in this
lab. General Runge-Kutta methods are a form of numerical analysis that
utilize an iterative method for differential equation solution approximation.
Proper Runge-Kutta implementation and function definition can save significant amounts of code, and was therefore imbedded into the developed program.
Other (non-RK4) functions were also defined and can be seen on my course
webpage (www2.hawaii.edu/kjbeamer/) under Lab 9 code.
The RK4 function was used in an iterative process in the code wherein new
values were calculated. At each consecutive step, the old value was set equal
to the newly calculated value so that the systems dynamically evolved, step by
step. The following is the 4th order Runge-Kutta (RK4) formulation.
k1 = dtf(t,y)
k2 = dtf(t+ dt
2 ,y(t)+k1 /2)
k3 = dtf(t+ dt
2 ,y(t)+k2 /2)
k4 = dtf(t+dt,y(t)+k3 )
y(t+dt) = y(t) + 61 (k1 + 2k2 + 2k3 + k4 )
With this RK4 formulation in the form of a function, the correct gravitational force and drag force were inserted into the functions. The program was
used to calculate the trajectory of a baseball in many different atmospheric situations. The only problem is that no error was calculated by the program as
I am unsure how to incorporate error into a seemingly perfectly deterministic
iterative process.

Data/Calculations

The projectile code was converted into an executionable and the range of a hit
vs. initial angle was calculated (data in Table 2) and graphed in Figure 2. As
the drag force is a function of and is further a function of exponential reliance
on height, we expect the zero drag case to produce the largest horzitontal range,
the Denver case to produce the second largest horizontal range (because Denver
sits at a higher altitude), and the NY case to produce the smallest horizontal
range. The data found in Table 2 confirms these predictions.

0 (deg)
30
35
40
45
50
55
60

No Drag Dist(m)
211.752
229.993
240.982
244.617
240.949
229.901
211.925

Drag in NY Dist(m)
116.292
120.601
121.765
120.279
116.111
109.371
100.067

Drag in Denver Dist(m)


125.230
130.376
132.228
130.950
126.550
119.426
109.431

Table 2 - Simulated values of distance travelled as a function of initial launch


angle for the no drag case and the two drag cases at different altitudes.
Evident in Table 2 are the maximum home run distances of different atmospheric conditions; one with no atmosphere, one with NYs atmosphere and
one with Denvers atmosphere. Because air density is exponentially related to
altitude, the maximum home run distances will also vary as a function of altitude. This explains why the maximum distance without drag is 2 times larger
than the maximum distance with drag in NY and 1.8 times larger than the
maximum distance with drag in Denver.
The following graph represents the total horizontal range spanned by baseballs launched at different initial angles. As theoretically expected, the red line
(no drag case) follows a perfect parabolic trajectory. Also as expected, a home
run hit in Yankee Stadium experiences more drag force and therefore covers less
horizontal range than a home run hit at Coors Field.
It is interesting to note that even though the two environments in which
the simulations take place differ by 1600 m, the range of values of horizontal
distance covered by the baseballs are always within 11 meters of each other.

Figure 2: Trajectories of baseballs launched with the same total speed, but at
different initial angles. The red, green and blue lines represent trajectories of
increasing drag force.
From Figure 2, it is evident that drag significantly affects the range. In the
no drag case, optimal horizontal distance is associated with an initial launch
angle of 450 , as is theoretically expected. Interestingly, when drag forces are
introduced (in NY and Denver), optimal horizontal distance is associated with
an initial launch angle of 400 . This has to do with the time that the baseballs
are in the air; the longer the duration, the longer the drag force is applied. This
explains why an angle slightly smaller than the theoretical expectation produces
a traversed distance. A baseball launched at a smaller angle will be in the air
for a shorter period, and will be subject to the drag force for a shorter period.
The following figure properly displays the affect that drag forces have on
trajectory. The seven trajectories with the largest x ranges are the baseballs hit
in the ideal, drag free case. The seven trajectories with the smallest x ranges
are of baseballs hit with the same initial conditions as the other seven, except
the addition of a drag force at sea level.

Figure 3: The trajectories of baseballs hit in NY, all with the same initial
velocity. The addition of a drag force can half the horizontal range of the
baseballs path.
Once the projectile programs was able to calculate trajectories while including height dependent drag forces, it was further modified to take head and tail
winds into account. Table 3 contains the data of the simulations at both altitudes, both with a 15 mph tail wind (wind in the same direction as the ball)
and a 15 mph head wind (wind in the opposite direction as the ball). This was
a simple adjustment to the code; being that 15 mph is equivalent to 6.7056 m
s ,
this value was simply added to the initial velocity in the tail wind case, and subtracted from the initial velocity in the head wind case. Simple vector addition
allows us to make this subtle mathematical change.
0 (deg)
30
35
40
45
50
55
60

Denver-tail(m)
146.498
151.617
152.948
151.034
145.701
137.116
125.519

NY-tail(m)
134.595
138.853
139.694
137.493
132.391
124.395
113.812

Denver-head(m)
103.412
108.119
110.273
109.479
106.186
100.346
92.0708

NY-head(m)
96.9197
101.049
102.520
101.623
98.4401
92.8267
85.1147

Table 3 - Simulated values of distanced traveled for different launch angles.


Data was taken at two altitudes with either a 15 mph tail or head wind.

The data in Table 3 is what was theoretically expected and is plotted in


the following figure. The difference between the red and green trajectories is
the altitude difference between NY and Denver. Being that Denver has a lower
atmospheric density, baseballs hit in Denver travel greater distances than those
in NY. The difference between the red and blue trajectories is the direction of
the wind. Being that a tail wind will add to the horizontal component of the
baseballs velocity, baseballs in this scenario will travel further distances, as is
evident in Figure 4.

Figure 4: A plot of the data in Table 3. For each respective tail or head wind
case, the baseball launched at the higher altitude location covered a greater
range.

Conclusion

The 4th order Runge-Kutta method again proves to be a valuable numerical


analysis technique to be utilized in code. The RK4s versatility through the
insertion of force laws makes it widely applicable to many dynamical systems
that are described by coupled differential equations. The projectile program
calculated drag trajectories that had smaller ranges than their no drag counter
parts. As the drag force depends on air density, experimental concepts agree
with theoretical concepts. It was also determined that a 450 home run launch
angle was optimal in vacuum, while a 400 home run launch angle was optimal in
all environments with drag. As theoretically expected, it was also determined
that at higher altitudes, drag forces are exponentially reduced.
7

References
1. Gorham, Peter. Physics305: Computational Physics. Index. N.p., n.d.
Web. 02 Apr. 2013. <http://www.phys.hawaii.edu/gorham/p305/P305index.html>.
2. Marion, Jerry B., and Stephen T. Thornton. Classical Dynamics of Particles and Systems. New York: Harcourt Brace and Company, 1988. Print.
3. Rainville, Earl D., and Phillip Edward Bedient. Elementary Differential
Equations. New York: Macmillan, 1969. Print.
4. The Path and Range of a Baseball. ThinkQuest. Oracle Foundation,
n.d. Web. 02 Apr. 2013. <http://library.thinkquest.org/11902/physics/range.html>.

You might also like