# channelflow.org

### Site Tools

gibson:teaching:spring-2018:math445:lab11

# Differences

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

 gibson:teaching:spring-2018:math445:lab11 [2018/05/01 06:20]gibson gibson:teaching:spring-2018:math445:lab11 [2018/05/01 06:23] (current)gibson Both sides previous revision Previous revision 2018/05/01 06:23 gibson 2018/05/01 06:20 gibson 2018/04/26 08:59 gibson 2018/04/26 05:57 gibson created 2018/05/01 06:23 gibson 2018/05/01 06:20 gibson 2018/04/26 08:59 gibson 2018/04/26 05:57 gibson created Line 38: Line 38: - **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$. + **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 the optimal angle is $\theta = \pi/4 \approx 0.79$ when there is no air resistance. 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$. ​ 