====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:summer-2017:techcamp:numerical-baseball [2017/07/18 07:23] gibson [Equations of motion with air resistance modeling] |
gibson:teaching:summer-2017:techcamp:numerical-baseball [2017/07/18 09:09] (current) gibson [Running the Matlab code to see the results] |
||
---|---|---|---|
Line 98: | Line 98: | ||
==== Solving the equations of motion numerically ==== | ==== Solving the equations of motion numerically ==== | ||
+ | |||
The file ``baseballsolve.m`` solves the above equations with some numerical solution methods, given | The file ``baseballsolve.m`` solves the above equations with some numerical solution methods, given | ||
Line 104: | Line 105: | ||
<code matlab> | <code matlab> | ||
+ | % Compute the trajectory of a baseball in flight, with and without | ||
+ | % air resistance and plot results | ||
+ | |||
x = 0.0; % horizontal position of home plate, meters | x = 0.0; % horizontal position of home plate, meters | ||
y = 1.0; % height of ball over strike zone | y = 1.0; % height of ball over strike zone | ||
Line 156: | Line 160: | ||
The thick black line shows the outfiled fence at 390 ft or 120 m, and 17 ft or 5.2 m high. | The thick black line shows the outfiled fence at 390 ft or 120 m, and 17 ft or 5.2 m high. | ||
- | **Questions** | + | ==== Question ==== |
* How important is the effect of air resistance? | * How important is the effect of air resistance? | ||
- | * Air density at Fenway park (sea level) is 1.196 kg/m^3. At one mile high in Denver, it's 0.986 kg/m^3. How much does the change in density affect the path of the ball at different angles and speeds? Try to change the above codes to find out. See if you can find a speed and angle that gives a home run in Denver but not at Fenway. | + | * Air density at Fenway park (sea level) is 1.196 kg/m^3. At one mile high in Denver, it's 0.986 kg/m^3. How much does the change in density affect the path of the ball at different angles and speeds? Try to change the above codes to show the path of the ball for both Fenway and Denver conditions. See if you can find a speed and angle that gives a home run in Denver but not at Fenway. |
* Play around with the parameters in the functions, like the speed and angle of the ball. Can you figure out the minimum speed and optimal angle to just clear the outfiled fence and hit a home run? | * Play around with the parameters in the functions, like the speed and angle of the ball. Can you figure out the minimum speed and optimal angle to just clear the outfiled fence and hit a home run? | ||
+ | ==== Next ==== | ||
+ | [[gibson:teaching:summer-2017:techcamp:computer-homerun | Hitting a home run]] | ||