• No results found

Table 2.1 outlines a simple program, called b a l l e , th at uses the Euler method to compute the trajectory of a baseball. Before running the program, let’s establish some reasonable values to take as inputs. An initial speed \x\\ = 15 m /s gives us a weakly hit ball (about 34 mph). Starting from the origin and neglecting air resistance, the tim e of flight is about 2.2 s, and the horizontal range is about 23 m when the initial angle is 0 = 45°. Here is what the output to the screen looks like when we run the MATLAB program under these conditions.

» b a l l e

b a l l e - Program t o compute t h e t r a j e c t o r y o f a b a s e b a l l u s in g t h e E u le r m ethod.

E n te r i n i t i a l h e i g h t (m e te r s ) : 0 E n te r i n i t i a l sp e e d (m /s ): 15 E n te r i n i t i a l a n g le ( d e g r e e s ) : 45 A ir r e s i s t a n c e ? ( Y e s : l , N o :0 ): 0 E n te r t i m e s t e p , t a u ( s e c ) : 0 .1 Maximum ra n g e i s 24.3952 m e te rs Time o f f l i g h t i s 2 .3 sec o n d s

The output from the C + + version is similar.

c i i . M 'i l·:/: 2. o n u s 1 h a s i c m h i i i o d s

_ 4

E

£ 3O)

‘ 2 1

0 -1

Projectile nnotion

' Euler method Theory (No air)

10 15

Range (m) 20 25

Figure 2.2: Output from b a l l e for an initial height of 0 rn, initial speed of 15 m /s. angle of 0 = 45°, and a time step of r = 0.1 s. There is no air resistance in this case; the difference between the theoretical curve and calculated points is due to the truncation error.

The trajectory computed by the program is shown in Figure 2.2. Using a time step of r = 0.1 s, the error in the horizontal range is about one meter, a4? expected from the truncation error. At this slow speed, the results are not much different when air resistance is included, since |F a (v i)|/m « g/7.

Next, let’s try to hit a homerun. Consider a larger initial velocity. |v i1 = 50 m /s (about 112 mph). Due to the air resistance, we find the range reduced to about 125 m, less than half of its theoretical maximum. The trajectory is shown in Figure 2.3; notice how it changes from a parabola to a sharply dropping curve.

This trajectory shows why a ball driven deep into the outfield always appears to be caught as though it is falling almost, straight down.

Our model equations for the flight of a baseball do not includc all the factors in the problem. The drag coefficient is not really a constant but instead is a complicated function of velocity. Furthermore, the spin on the ball adds to the lift (Magnus cffcct). If you are interested in learning more, there are several good books on this fascinating subject /4, 131]

EXERCISES

1. (a) Using Taylor expansion, derive the three-point forward difference formula f a ) = d m ± i / ( * + T ) - /( * + 2 T ) + 0 (t2 )

and obtain an explicit: expression for the error term. [Pencil]

2. Write a program that computes f { x ) using the right derivative formula. Equation (2.11), and plots a graph of absolute error similar to Figure 1.3. Plot the error in the

2 1. PROJECTILE M O T IO N 45

Projectile motion

Range(m)

Figure 2.3: O utput from b a ll e for an initial height of 1 in, initial speed of 50 m /s, angle of 0 = 45°, and a time step of r = 0.1 s,

calculation of the derivatives of: (a) x2at x = 1; (b) x bat x= 1; (c) sin a; at x = 0;

(d) sinx· at x = 7r/4; and (e) sin a; at x= 7r/2. [Computer

3. The balle program overestimates the range and time of flight (Figure 2.4). Fix this bit of sloppy programming: Compute a corrected maximum range and time of flight by interpolating between the last three values of r using the in trp f function from Section 1.4. Measure the improvement in the computed range and time of flight when there is no air resistance. Take an initial height of 0 m, initial speed of 50 m /s?

angle of 0 = 45°, and try a variety of values for the time step t. [Computer]

4. Take your program from the previous exercise and create two new versions that use the Euler-Cromer and midpoint methods. With no air resistance, find the largest value of t that gives you. a 1% error in the horizontal range (take y i = 0 m , vi = 50 m/s, and 0 = 45°). Comment on the performance of the three numerical methods. [Computer]

5. Suppose that a batter hits a ball and gives it an initial velocity of 50 m/s (take yi = 1 m). Modify b a lle so that it produces a plot of horizontal range as a function of angle for 10° < $ < 50°. Determine the angle (to within 1°) at which the maximum range is achieved. [Computer]

6. In Two New Sciences [5, 52] Galileo claims that if a 100-lb iron ball and a 1-lb iron ball were dropped from a height of 100 braccia (about 50 m), then “when the larger one strikes the ground* the other is two inches behind it.” (a) Modify b alle to simultaneously compute the motion of two objects, and show that this statement is grossly inaccurate. Assume that C<\ = 0.5 (smooth sphere); density of iron is 7.8 g/cm3. [Computer] (b) Show that yit) = y( 0) - 6-1 log (cosh {y/bgt)) where b = CdpA/2m. Use this result to check your answer in part (a). [Pencil] (c) What would C<\ need to be for Galileo’s statement to be accurate? [Computer]

7. Consider a pair of identical 1-lb iron balls dropped from a height of 50 m (see previous exercise). One ball has zero initial velocity, the other an initial velocity

Simple range

Figure 2.4: Improved calculation of horizontal range.

of 50 m /s in the horizontal direction. Modify b a lle to simultaneously compute the motion of two objects to determine the halls’ separation, horizontal and vertical, when one strikes the ground. Which ball reaches the ground first? [Computer]

8- Suppose that an outfielder catches a fly ball 320 ft from home plate. The moment the hall is caught, a base runner on third base takes off for home plate to try to score on the sacrifice fly. The outfielder can throw the ball with a speed of 95 mph (initial height is 2 in).* At what angle should she throw? How much time does it. take for the ball to arrive at the plate? A typical base runner will roach home in about 3.5 to 4.5 s. [Computer]

9. Modify b a lle to account for wind. Suppose that a batter hits a hail and gives it an initial velocity of 110 mph at an angle of ti = 35° from the horizontal (initial height is 1 m). Make a plot of horizontal range versus horizontal wind velocity for values between 40 mph and —40 mph. [Computer]

10. The drag coefficient for a baseball is really not a constant but rather varies with velocity. 51] Modify b a lle to use the values

v (mph) 0 25 50 75 100 125

c d 0.5 0.5 0.5 0.4 0.28 0.23

using quadratic interpolation to estimate Cd(») (see Section 1.4). Plot horizontal range versus angle, as described in Exorcise 2.5, and comment on the results. Does the range increase or decrease as compared to using a constant. Cci = 0.35? [Computer]

2.2 SIMPLE PENDULUM

Basic Equations

The motion of pendula has fascinated physicists since Galileo was hypnotized by the lamp in the cathedral at Pisa. The problem is treated in the standard

H f this- speed seems high, recall that an outfielder may throw on the run. unlike the restricted motion required o f a pitcher.

22. SIMPLE PENDULUM 47 mechanics texts, but before rushing to the computer let’s review some basic results. For a simple pendulum it is more convenient to describe the position in term s of the angular displacement, 0(t). The equation of motion is

i g = - 2 si„» (2.26)

where L is the length of the arm and g is the gravitational acceleration. In the small angle approximation, sin# as 9. Equation (2.26) simplifies to

% = - 1 9 <2 2 7 >

This ordinary differential equation is easily solved to obtain

9{t) = C?! cos(27r*/T6 + C2) (2.28) where the constants C\ and C2 are determined by the initial values of 9 and uj = d9/dt. The small angle period, TS; is

= 2 n \ i î (2.29)

This approximation is reasonably good for oscillations with amplitudes of about

20° or less.

W ithout the small angle approximation, the equation of motion is more difficult to solve. However, we know from experience th at the motion is still periodic. In fact, it is possible to obtain an expression for the period without explicitly solving for 9(t). The total energy is

E = ^ m L 2w2 - m g L cos 0 (2.30) where m is the mass of the bob. The total energy is conserved and equal to E = —m gL cos0m, where 9m is the maximum angle. From the above, we have i m L 2co2 - m gL cos 0 = - m g L cos (2.31) or

u j2= (cos 0— cos 0m) (2.32)

L Since u> = dBjdt,

i t = (2.33)

y ^ ( cos0 — cos<?m)

In one period the pendulum swings from 0 = 0m to 0 = —6m and back to 6 — Sm.

Thus, in a half period the pendulum swings from 6 = to $ — —0m. Last, by

t U : \ r n , U 'J. D I M S I: H A S H ’ M I / l l l O D S

the same argument:, in a quarter period I hr ponduliiin swings from (I 0n, to 9 = 0. thus integrating both sides,

- = [ £

I0"

d $ (9 % i\

4 y 2g J0 i/cos0 - cos0u;

This integral may be rewritten in terms of special functions by using the identity cos 20 = 1 — 2 sin2 so

<#

>/sin2 ( i V 2 ) - sin2 (0 /2 )

(2.35)

V

Introducing .K^a), the complete elliptic integral of the first kind, [62]

r7r/2

\ / 1 — a*2 sirr 2

wo may write the period as

I<(x) == / ^ dz (2.36)

-/() \ / l - # 2 sirrz

r = 4 ^ ( i n i » . )

using the change of variable sin z = 8in(0/2)/sm '0TI1/2). For small values of 0m, we may expand K ( x ) to obtain

r=2’ \ / l ( i + i59"'+ " ) <238i

Notice that the leading term is the small angle approximation (2.29).