projectile motion with air resistance in matlab

4 views (last 30 days)
An artillery shell is launched against air resistance. the equation for the Y position is Y=(M/A)^2*(sin(theta)-g)*(exp(-At/M)-1)+(1/2)*gt^2 and the equation for the X position is X=(M/A)(exp(-AT/M)-1) where M= mass of the shell (lets say 5) A=coefficient of air resistance (lets say .5) g=gravity=9.8 theta, t, and x are unknown Y=0 when the shell lands. I need to find a way to determine what value of theta (angle of launch) will give me the maximum distance in the x direction, and then solve for that distance. I assume I need to set Y=0 and solve for t, then input that function into X in order to eliminate the variable; however, in this case it is not possible to solve for t analytically. How would I use matlab to do this? for loop? while loop? In the aspect of programming, how would I go about solving this?
If there is any way i could just see an example of how this would be as seen in the program, that would help me much more than any explanation, although any other input would be greatly appreciated as well. Thanks.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!