Let's Break Down the Physics of a Wickedly Curving Baseball - 9 minutes read
Let's Break Down the Physics of a Wickedly Curving Baseball
The twitter worldis going crazy over this epic pitch by Oliver Drake of the Tampa Bay Rays. Of course it's real, but why does this happen? In physics, you don't really understand something until you can model it—so let's do just that. I'm going to walk through the steps of modeling an awesome pitch like this. There will be some physics and there will be some coding. But don't worry, it's going to be fun.
The great thing about physics is that we can start off with the simplest model possible and then just continue to make it slightly more complicated. So, what is the easiest way to show the motion of a pitched baseball? Let's just assume it travels from the pitching mound to the plate with a constant velocity of 85 mph (38 m/s). Oh, let's say the distance from mound to plate is 60 feet (18.3 meters).
Here's how this will work. We can break this motion into very small intervals of time—let's go with 0.01 seconds. At the beginning of this time interval, the ball will have some position, let's call it r1. If the velocity is v, then using the definition of average, I can find the position at the end of this interval. I will call this second position r2. The little arrows over them indicated that these are vector quantities. That's not very important now, but it will be for later steps. Here is how I would calculate this second position.
This calculation is simple enough that you could do it on paper. But if the baseball takes even 1 second to travel to the plate, a time interval of 0.01 seconds would mean 100 calculations. No one has time for that. Instead, I'm going to make a computer do it. Computers don't complain (very much).
Here is the code for this constant-velocity baseball. (There's one patch of complicated stuff in there, which you can ignore; that's just to draw the mound, the ball, and the plate.) Click Play to run the visualization. Note that this is a view of the pitch from above:
For fun, you can edit this code—for instance to change the velocity of the pitch (line 4). Click the pencil icon to return to edit mode, then hit Play to rerun it. Now, let's look closer at the code. Really, the most important part is line 30:
This is the position update formula. The last term, ball.p x dt/m, gives us the distance moved. It's just velocity, which I write as momentum (p) over mass (m), multiplied by the change in time, dt. This formula might look a little weird; it seems like the ball.pos term would cancel, since it's on both sides of the equation. Aha! But that's not an equation. In Python the equal sign does not mean "equal"; it means "make it equal to." So the computer takes the old position of the ball, adds the distance moved, and then sets that as the new position. It takes a little time to understand how computers think.
The constant-velocity baseball was boring and too easy. But notice that even with the oversimplification of constant velocity, it was still fairly useful. I could use it to calculate the time it takes the ball to get to the plate and even get a visual representation of the motion. But as usual, we can make this better by adding to the code.
In this case, let's add the gravitational force to the ball. This force depends on the mass of the ball and the gravitational field (g) with a value of about 9.8 newtons per kilogram. Now that there is a force on the ball, it won't travel at a constant velocity. Instead, this force will change the ball's momentum, p (where momentum is the product of mass and velocity). This momentum is updated during each time interval in a manner very similar to the way the position is updated.
In order to make this work, I only need to add three lines to the previous model. Yes, only three lines—I could technically do it with just two lines. The first line adds an initial vector direction to the baseball so that you can "throw it" at different angles. Here are the other two lines.
This just calculates the vector force (remember that g is a vector) and then uses this to update the momentum. Here is the rest of the code.
I have two quick comments. First, remember that this is a top view. Just to be clear. Second, we had to cheat to model this motion. OK, we could have done this without cheating—we just cheated for fun. Where is the cheat? It's back in that position update line (in this new code it's in line 34). The problem is that we updated the momentum (and thus the velocity) but we used the final velocity instead of the average velocity to find the new position. That's wrong. But with a small time interval, it's just a little bit wrong. Trust me, everything will work out fine.
If we want a more realistic baseball, we need another force—the air resistance force. As the ball moves through the air, there is a force pushing in the opposite direction of the ball's velocity. This is the air resistance. Although it's really a very complicated interaction between the ball and all the air molecules, we can still get a fairly nice model with the following equation.
Don't freak out. I'm going to go over each term in this expression.
Let's add this to the code.
The final position of the ball isn't that much different than in the case without air drag. The ball only moves a short distance, so the air drag doesn't have too much time to change the ball's momentum. But still—it's there. Here's some homework for you. Try changing the drag coefficient and see how much that alters the final position of the ball.
This is it. This is what you were waiting for. Just like the air resistance force, the Magnus effect is an interaction between the ball and the air. The difference is that this force is due to a spinning ball. As the ball both moves and spins, the friction between the surface of the ball and the air sort of pulls the air off to the side. This change in momentum of the air produces a force on the ball in the other direction. This diagram might help.
The direction of this Magnus force is perpendicular to both the velocity vector and the angular velocity vector (which is in the direction of the axis of rotation). The magnitude of the force depends on the velocity, the angular velocity, the area of the ball, the density of air and a Magnus coefficient (CM). As an equation, it looks like this:
Yes, that F-hat vector at the end doesn't really tell you much except for the direction of the force. I can calculate this direction using the cross product (which I really shouldn't get into too much):
Before I put that force into the code, I need to first find that Magnus coefficient (CM). According to this paper—"The effect of spin on the flight of a baseball", by Alan Nathan—there are several ways to calculate the coefficient, but in general it depends on the object's speed, angular velocity, and type of surface. There is an experimental table to look up the value, but it seems it should be between 0.2 and 0.3. Just for fun, I'm going with 0.3. I also increased the air resistance coefficient and put the angular velocity at 2,000 rpm. Here's what I get:
Looking at the output, this model gives a horizontal deviation of almost a meter (about 3 feet). That's really extreme, but it still doesn't look as bonkers as Oliver Drake's pitch. I suspect the effect in the video is a combination of the ball's motion and the camera angle. Because you're looking from behind the pitcher there, the deviation of the ball looks even more insane. If I was better at coding, I could get the virtual camera to be in the same position as the real camera at the game.
But in the end, I'm not a baseball expert. I just know how to model stuff with code. And now you know how too.
Source: Wired
Powered by NewsAPI.org
Keywords:
Physics • Baseball • Twitter • Oliver Drake (baseball) • Tampa Bay Rays • Physics • Physics • Physics • Baseball • Baseball field • Physical constant • Velocity • Miles per hour • Metre per second • Distance • Plate tectonics • Foot (unit) • Metre • Motion (physics) • Time • Second • Time • Velocity • Interval (mathematics) • Little Arrows • Time • Computer • Computer • Velocity • Baseball • Line 4, Beijing Subway • Icon (computing) • Position (vector) • Time • Distance • Velocity • Momentum • Mass • Multiplication • Formula • Addition • Equation • A-ha • Equation • Python (programming language) • Equals sign • Computer • Position (vector) • Distance • Position (vector) • Takes a Little Time (Amy Grant song) • Computer • Velocity • Baseball • Velocity • Time • Motion (physics) • Gravity • Mass • Gravity • Angular momentum operator • Newton (unit) • Kilogram • Physical constant • Velocity • Momentum • Momentum • Multiplication • Mass • Velocity • Momentum • Time • Position (vector) • Work (physics) • Line (geometry) • Euclidean vector • Angle • Euclidean vector • Force • Euclidean vector • Momentum • Velocity • Time • Wrongdoing • Trust Me (TV series) • Baseball • Drag (physics) • Motion (physics) • Velocity • Drag (physics) • Molecule • Nice model • Equation • Freak Out! • Time • Position (vector) • Drag (physics) • Distance • Drag (physics) • Momentum • Drag coefficient • This Is It (Kenny Loggins song) • Drag (physics) • Magnus effect • Motion (physics) • Spin (physics) • Friction • Surface (topology) • Atmosphere of Earth • Atmosphere of Earth • Momentum • Atmosphere of Earth • Direction (geometry) • Direction (geometry) • Magnus effect • Perpendicular • Velocity • Angular velocity • Velocity • Direction (geometry) • Rotation around a fixed axis • Euclidean vector • Force • Angular velocity • Ball • Density of air • Magnus effect • Equation • Euclidean vector • Force • Cross product • Force • Spin (physics) • Baseball • Physical body • Speed • Angular velocity • Experiment • Drag (physics) • Coefficient • Angular velocity • Revolutions per minute • Power (physics) • Mathematical model • Metre • Bonkers (song) • Oliver Drake (baseball) • Camera angle • Pitcher • Virtual camera system • Game • Baseball • Now You Know (Desperate Housewives) •
The twitter worldis going crazy over this epic pitch by Oliver Drake of the Tampa Bay Rays. Of course it's real, but why does this happen? In physics, you don't really understand something until you can model it—so let's do just that. I'm going to walk through the steps of modeling an awesome pitch like this. There will be some physics and there will be some coding. But don't worry, it's going to be fun.
The great thing about physics is that we can start off with the simplest model possible and then just continue to make it slightly more complicated. So, what is the easiest way to show the motion of a pitched baseball? Let's just assume it travels from the pitching mound to the plate with a constant velocity of 85 mph (38 m/s). Oh, let's say the distance from mound to plate is 60 feet (18.3 meters).
Here's how this will work. We can break this motion into very small intervals of time—let's go with 0.01 seconds. At the beginning of this time interval, the ball will have some position, let's call it r1. If the velocity is v, then using the definition of average, I can find the position at the end of this interval. I will call this second position r2. The little arrows over them indicated that these are vector quantities. That's not very important now, but it will be for later steps. Here is how I would calculate this second position.
This calculation is simple enough that you could do it on paper. But if the baseball takes even 1 second to travel to the plate, a time interval of 0.01 seconds would mean 100 calculations. No one has time for that. Instead, I'm going to make a computer do it. Computers don't complain (very much).
Here is the code for this constant-velocity baseball. (There's one patch of complicated stuff in there, which you can ignore; that's just to draw the mound, the ball, and the plate.) Click Play to run the visualization. Note that this is a view of the pitch from above:
For fun, you can edit this code—for instance to change the velocity of the pitch (line 4). Click the pencil icon to return to edit mode, then hit Play to rerun it. Now, let's look closer at the code. Really, the most important part is line 30:
This is the position update formula. The last term, ball.p x dt/m, gives us the distance moved. It's just velocity, which I write as momentum (p) over mass (m), multiplied by the change in time, dt. This formula might look a little weird; it seems like the ball.pos term would cancel, since it's on both sides of the equation. Aha! But that's not an equation. In Python the equal sign does not mean "equal"; it means "make it equal to." So the computer takes the old position of the ball, adds the distance moved, and then sets that as the new position. It takes a little time to understand how computers think.
The constant-velocity baseball was boring and too easy. But notice that even with the oversimplification of constant velocity, it was still fairly useful. I could use it to calculate the time it takes the ball to get to the plate and even get a visual representation of the motion. But as usual, we can make this better by adding to the code.
In this case, let's add the gravitational force to the ball. This force depends on the mass of the ball and the gravitational field (g) with a value of about 9.8 newtons per kilogram. Now that there is a force on the ball, it won't travel at a constant velocity. Instead, this force will change the ball's momentum, p (where momentum is the product of mass and velocity). This momentum is updated during each time interval in a manner very similar to the way the position is updated.
In order to make this work, I only need to add three lines to the previous model. Yes, only three lines—I could technically do it with just two lines. The first line adds an initial vector direction to the baseball so that you can "throw it" at different angles. Here are the other two lines.
This just calculates the vector force (remember that g is a vector) and then uses this to update the momentum. Here is the rest of the code.
I have two quick comments. First, remember that this is a top view. Just to be clear. Second, we had to cheat to model this motion. OK, we could have done this without cheating—we just cheated for fun. Where is the cheat? It's back in that position update line (in this new code it's in line 34). The problem is that we updated the momentum (and thus the velocity) but we used the final velocity instead of the average velocity to find the new position. That's wrong. But with a small time interval, it's just a little bit wrong. Trust me, everything will work out fine.
If we want a more realistic baseball, we need another force—the air resistance force. As the ball moves through the air, there is a force pushing in the opposite direction of the ball's velocity. This is the air resistance. Although it's really a very complicated interaction between the ball and all the air molecules, we can still get a fairly nice model with the following equation.
Don't freak out. I'm going to go over each term in this expression.
Let's add this to the code.
The final position of the ball isn't that much different than in the case without air drag. The ball only moves a short distance, so the air drag doesn't have too much time to change the ball's momentum. But still—it's there. Here's some homework for you. Try changing the drag coefficient and see how much that alters the final position of the ball.
This is it. This is what you were waiting for. Just like the air resistance force, the Magnus effect is an interaction between the ball and the air. The difference is that this force is due to a spinning ball. As the ball both moves and spins, the friction between the surface of the ball and the air sort of pulls the air off to the side. This change in momentum of the air produces a force on the ball in the other direction. This diagram might help.
The direction of this Magnus force is perpendicular to both the velocity vector and the angular velocity vector (which is in the direction of the axis of rotation). The magnitude of the force depends on the velocity, the angular velocity, the area of the ball, the density of air and a Magnus coefficient (CM). As an equation, it looks like this:
Yes, that F-hat vector at the end doesn't really tell you much except for the direction of the force. I can calculate this direction using the cross product (which I really shouldn't get into too much):
Before I put that force into the code, I need to first find that Magnus coefficient (CM). According to this paper—"The effect of spin on the flight of a baseball", by Alan Nathan—there are several ways to calculate the coefficient, but in general it depends on the object's speed, angular velocity, and type of surface. There is an experimental table to look up the value, but it seems it should be between 0.2 and 0.3. Just for fun, I'm going with 0.3. I also increased the air resistance coefficient and put the angular velocity at 2,000 rpm. Here's what I get:
Looking at the output, this model gives a horizontal deviation of almost a meter (about 3 feet). That's really extreme, but it still doesn't look as bonkers as Oliver Drake's pitch. I suspect the effect in the video is a combination of the ball's motion and the camera angle. Because you're looking from behind the pitcher there, the deviation of the ball looks even more insane. If I was better at coding, I could get the virtual camera to be in the same position as the real camera at the game.
But in the end, I'm not a baseball expert. I just know how to model stuff with code. And now you know how too.
Source: Wired
Powered by NewsAPI.org
Keywords:
Physics • Baseball • Twitter • Oliver Drake (baseball) • Tampa Bay Rays • Physics • Physics • Physics • Baseball • Baseball field • Physical constant • Velocity • Miles per hour • Metre per second • Distance • Plate tectonics • Foot (unit) • Metre • Motion (physics) • Time • Second • Time • Velocity • Interval (mathematics) • Little Arrows • Time • Computer • Computer • Velocity • Baseball • Line 4, Beijing Subway • Icon (computing) • Position (vector) • Time • Distance • Velocity • Momentum • Mass • Multiplication • Formula • Addition • Equation • A-ha • Equation • Python (programming language) • Equals sign • Computer • Position (vector) • Distance • Position (vector) • Takes a Little Time (Amy Grant song) • Computer • Velocity • Baseball • Velocity • Time • Motion (physics) • Gravity • Mass • Gravity • Angular momentum operator • Newton (unit) • Kilogram • Physical constant • Velocity • Momentum • Momentum • Multiplication • Mass • Velocity • Momentum • Time • Position (vector) • Work (physics) • Line (geometry) • Euclidean vector • Angle • Euclidean vector • Force • Euclidean vector • Momentum • Velocity • Time • Wrongdoing • Trust Me (TV series) • Baseball • Drag (physics) • Motion (physics) • Velocity • Drag (physics) • Molecule • Nice model • Equation • Freak Out! • Time • Position (vector) • Drag (physics) • Distance • Drag (physics) • Momentum • Drag coefficient • This Is It (Kenny Loggins song) • Drag (physics) • Magnus effect • Motion (physics) • Spin (physics) • Friction • Surface (topology) • Atmosphere of Earth • Atmosphere of Earth • Momentum • Atmosphere of Earth • Direction (geometry) • Direction (geometry) • Magnus effect • Perpendicular • Velocity • Angular velocity • Velocity • Direction (geometry) • Rotation around a fixed axis • Euclidean vector • Force • Angular velocity • Ball • Density of air • Magnus effect • Equation • Euclidean vector • Force • Cross product • Force • Spin (physics) • Baseball • Physical body • Speed • Angular velocity • Experiment • Drag (physics) • Coefficient • Angular velocity • Revolutions per minute • Power (physics) • Mathematical model • Metre • Bonkers (song) • Oliver Drake (baseball) • Camera angle • Pitcher • Virtual camera system • Game • Baseball • Now You Know (Desperate Housewives) •