Question: MATLAB HELP Problem 1: Equations 1 and 2 give the horizontal and vertical position (x and y, respectively) of a projectile as a function of
MATLAB HELP
Problem 1: Equations 1 and 2 give the horizontal and vertical position (x and y, respectively) of a projectile as a function of time (t), initial velocity (Vo), initial angle (?o), and the acceleration due to gravity (g = 9.81 m/s). x(t) = tV0cos(?) (1) y(t) = tV0sin(?)-1/2 gt2 (2) Given these equations, use MATLAB to solve the following items:
1. Solve for the time at which the projectile hits the ground as a function of the initial conditions V0 and ?o
2. Suppose the projectile just described is fired at an initial velocity (V0) of 100 m/s and a launch angle (?o) of ?/4. Find the distance traveled both horizontally (x) and vertically (y) for t=0 to tmax with a spacing (step size) of 0.01 seconds. Graph horizontal distance versus time (with time on the x-axis). In a new figure window, plot vertical distance versus time (again with time on the x-axis). Clearly label the axes and add a title.
3. In yet another new figure window, use the comet() function to plot the horizontal distance (x) on the x-axis and vertical distance (y) on the y-axis. If the plot draws too quickly or too slowly on your computer, adjust the number of time values used in your calculations. Hint: Dont forget you can look the comet function up in Matlab help or by googling it.
4. Calculate three new vectors for the vertical (y1, y2, y3) and horizontal (x1, x2, x3) distances traveled, assuming launch angles of ?/2, ?/4, and ?/6. In a new figure window, graph horizontal distances on the x-axis and vertical distances on the y-axis, for all three cases (youll have three lines in one plot/figure). Make one solid, one dashed, and one dotted. Add a legend to identify which line is which.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
