Sie sind auf Seite 1von 7

Lab Report #8

Home run using Runge Kutta


Grace Jung
04/17/2012
Introduction

Hitting a home run can be interpreted as a simple projectile motion problem. In introductory courses,

these projectile motion problems were always in situations where there was no air resistance.

Using the

Runge Kutta 4 method, we can now complicate the situation and get a result that is more consistent with
reality.

Theory

In this lab, we use Runge Kutta 4 (RK4) to solve the projectile motion problem with drag. The method

is used to solve ordinary dierential equations. [1]


Suppose we have a function

y(t)

and corresponding

f (y, t) =

dy
dt . The general RK4 equations are given

as follows: [2]

y(t + h) = y(t) +

1
(k1 + 2k2 + 2k3 + k4 )
6

k1 = h f (t, y)

(1)

(2)

k2 = h f (t +

k1
h
, y(t) + )
2
2

(3)

k3 = h f (t +

h
k2
, y(t) + )
2
2

(4)

k4 = h f (t + h, y(t) + k3 )

(5)

To apply RK4 to the projectile motion problem, we must rst determine our equations of motion.

dv
= mg bv 2
dt
dx
=v
dt

where

is the mass of the projectile,

drag force, and

The drag force depends on the velocity

is the velocity,

Cd

is the magnitude of gravity on Earth,

is the drag coecient,

v , x)

is the

are all 2D vectors.

and the variable

b=

(7)

is the position. Note that in equation (6), we have both the force of gravity and the drag

force. For simplication purposes, all vectors (g ,

where

(6)

1
(Cd A)
2

b.

Using Bernoulli's law [3], we nd that

(8)

is the cross sectional area of the projectile, and

is the density.

is also a variable that depends on height. [4]


h

= 0 e h0
where

0 is

the density at sea level,

(9)

is the height of the projectile, and

h0 is

the scale height of the

atmosphere, which is 8300m sea level.


Combining equation (8) and (9), we can get the full expression for drag force.
equation (6), we can nd the velocity and position of the projectile.

By applying RK4 to

Problem

Create a program that will apply the RK4 method to the projectile motion with drag problem.

The

program will be given a set of initial conditions and should be able to calculate the position and velocity of
the projectile at any point in time. It should also be able to calculate the position and velocity for dierent
initial angles.
Analyze the eects of drag and no drag on the maximum range of the projectile and the angle at which
the maximum range occurs. Also inspect how dierent altitudes aect the range of the projectile. Lastly,
observe how an additional wind will aect the range of the projectile.

Data and Analysis

honrudai.cpp uses the RK4 method to determine the position and velocity of a perfectly spherical baseball.

Figure 1. Range of projectile for various initial angles with drag


We would expect the maximum range to occur at an angle less than 45 degrees, but the program gives
a maximum range at an angle of 50 degrees. This implies that our drag force is not working as it should.

Figure 2. Range of projectile for various initial angles without drag


In the idealized case without drag, the maximum range occurs at 45 degrees.
theory. We can also see that

n

have the same range.

This is consistent with

Figure 3. Motion of projectile for various initial angles with drag


The gure shows the range and height of the projectile as it travels. We can see that the endpoints of

40 and 60 , 45 and 55

are the same. The maximum range occurs at

expectations.

50 .

This is not consistent with our

Figure 4. Motion of projectile for various initial angles without drag


The gure shows the range and height of the projectile as it travels. We see that the endpoints for
the same. The maximum range occurs at

45

as expected.

n are

Figure 5. Motion of projectile in Denver and New York with drag


We now observe how dierent altitudes aect the maximum range of the projectile. New York is located
at about sea level and Denver is located approximately 1600m above sea level.

In gure 5, New York is

represented by the green line, and Denver is represented by the red line. We see that increasing the altitude
also increases the maximum range. This is consistent with our expectations.

Figure 6. Motion of projectile with wind and drag


We also observe how the presence of wind aects the maximum range of the projectile. The blue line
represents no wind. The red and green lines represent the addition of wind. Red corresponds to a wind in
the direction of the projectile's velocity and green corresponds to a wind in the direction opposite of the
projectile's velocity. In both cases, the wind has a magnitude of 15mph (6.7056m/s).
We can see that a wind in the same direction increases the maximum range while a wind in the opposite
direction decreases the maximum range.

It is also interesting to note that because the magnitude of the

winds were the same, the change in maximum range for both cases were the same. In addition, the increase
in maximum range due to winds is greater than the increase in range due to higher altitudes in Denver.

Conclusion

We were able to investigate how drag aects the motion of a projectile using the RK4 method. Unfortu-

nately, there appears to be an error in the program used. This is most obvious when observing the angle at
which the maximum range occurs. With drag, this angle should be
output of

50

< 45 .

However the program gives an

. However, the program works ne without any drag.

Despite the aw mentioned, the program was able to depict other situations well.

We found that at

higher altitudes, the maximum range of the projectile is increased. Winds will also increase or decrease the
maximum range depending on the direction of the winds.

References

[1] Weisstein, Eric W. "Runge-Kutta Method." http://mathworld.wolfram.com/Runge-KuttaMethod.html

[2] Runge Kutta Method for O.D.E.'s http://math.fullerton.edu/mathews/n2003/RungeKuttaMod.html

[3] Benson, Tom. "The Drag Equation." http://www.grc.nasa.gov/WWW/K-12/airplane/drageq.html

[4] Varner, Gary. Dierential Equations. http://www.phys.hawaii.edu/~varner/PHYS305-Spr12/P305_lab8.html

Das könnte Ihnen auch gefallen