User Tools

Site Tools


gibson:teaching:spring-2016:math445:lab12

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gibson:teaching:spring-2016:math445:lab12 [2016/04/27 13:34]
gibson
gibson:teaching:spring-2016:math445:lab12 [2016/05/03 06:50] (current)
gibson
Line 18: Line 18:
 $ dy/dt = v_y $  $ dy/dt = v_y $ 
  
-$ dv_x/dt = -\mu v_x \sqrt{v_x^2 + v_y^2}$ ​+$ dv_x/dt = -\frac{\mu}{m} v_x \sqrt{v_x^2 + v_y^2}$ ​
  
-$ dv_y/dt = -g - \mu v_y \sqrt{v_x^2 + v_y^2}$+$ dv_y/dt = -\frac{\mu}{m} v_y \sqrt{v_x^2 + v_y^2} ​- g$
  
-The constant $g = 9.81 m/s^2$ is the acceleration due to gravity. The constant $\mu = 1/2 \rho_{air} C_D A/m$ in the air resistance term depends on physical characteristics of the projectile and the air. The following code will calculate $\mu$ for a standard baseball, given either value of $\rho_{air}$.+The constant $g = 9.81 m/s^2$ is the acceleration due to gravity. The constant $\mu = \rho_{air} C_D A/2$ in the air resistance term depends on physical characteristics of the projectile and the air. The following code will calculate $\mu$ for a standard baseball, given either value of $\rho_{air}$.
  
 <​code>​ <​code>​
Line 34: Line 34:
 m = 0.145; ​      % mass of baseball in kg (145 gm m = 0.145; ​      % mass of baseball in kg (145 gm
  
-mu = rho_air*C_D*A/​(2*m); % coefficient of nonlinear |v|^2 term, in mks units+mu = rho_air*C_D*A/​2;​ % coefficient of nonlinear |v|^2 term, in mks units
 </​code>​ </​code>​
  
  
-**Problem 2:** Determine the minimum initial ball speed and optimal angle that result in a home run, at sea level, and in Denver. You'll have to start with a guess and tweak it by stages. For a starting point, recall that a good fastball clocks at 90 mph or roughly 40 m/s, and that 45 degrees is $\theta =\pi/4 \approx 0.78$. ​+**Problem 2:** Determine the minimum initial ball speed and optimal angle that result in a home run, at sea level, and in Denver. You'll have to start with a guesses for $v_0$ and $\theta$ ​and tweak them by stages. For a starting point, recall that a good fastball clocks at 90 mph or roughly 40 m/s, and that 45 degrees is $\theta =\pi/4 \approx 0.78$. ​
  
 Note that Matlab'​s ode45 function will return the x,y positions of the trajectory points at discrete time intervals, and it's unlikely that any of these will line up exactly with the outfield fence. However you can use interpolation to get the ball height y at exactly at the fence, as follows. If you set up your Matlab code so that $x$ is //x(:,1)// and $y$ is //x(:,2)//, the following code will determine the height $y$ of the ball at the position of the fence, $x=120$. ​ Note that Matlab'​s ode45 function will return the x,y positions of the trajectory points at discrete time intervals, and it's unlikely that any of these will line up exactly with the outfield fence. However you can use interpolation to get the ball height y at exactly at the fence, as follows. If you set up your Matlab code so that $x$ is //x(:,1)// and $y$ is //x(:,2)//, the following code will determine the height $y$ of the ball at the position of the fence, $x=120$. ​
Line 48: Line 48:
  
 **Problem 4:** Do the same as problem 3 for the home run in Denver. ​ **Problem 4:** Do the same as problem 3 for the home run in Denver. ​
 +
 +**Problem 5:** What are your answers for the minimal speed and optimal angle in the more familiar units of miles per hour and degrees, for both Boston and Denver?
gibson/teaching/spring-2016/math445/lab12.1461789245.txt.gz · Last modified: 2016/04/27 13:34 by gibson