Different launch angles for a tennis ball

2 次查看(过去 30 天)
How far can you throw a tennis ball? Our goal is to find the launch angle θ, measured up from the ground, that will result in the ball traveling as far forward (in the x direction) as possible. Assume that you can throw the ball at 12 meters/second from a height of 2 meters.
When you need to account for drag, you can assume that the ball’s radius is 0.0265 meters, the ball’s mass is 0.058 kg, the drag coefficient is 0.5, and the density of air is 1.21 kg/meter
We were told to use eulerballistic function
function z = eulerballistic(f, z0, deltat)
z = z0;
i = 1;
while z(2,i) > 0
zprime = f(z(5,i), z(:,i));
z(:,i+1) = z(:,i) + deltat*zprime;
i = i + 1;
if i > 100
break;
end end
end
With everything going on, I have forgotten some of how to start a problem like this. Any help would be much appreciated.
  3 个评论
James Tursa
James Tursa 2020-4-30
I'm assuming the density is 1.21 kg/meter^3, not 1.21 kg/meter.
James Tursa
James Tursa 2020-4-30
How is z defined? (i.e., what are each of the elements?). How is f defined?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by