Question: Problem 2 : Let's make a plot that shows the vector velocity of a ball undergoing projectile motion ( neglecting air resistance ) . Recall

Problem 2:
Let's make a plot that shows the vector velocity of a ball undergoing projectile motion (neglecting air resistance).
Recall the kinematic equations used to calculate the trajectory (or the x and y-positions) of a ball undergoing projectile motion are as follows:
x=x0+vx0t
y=y0+vy0t-12gt2
where x0 and y0 are the initial positions in the x and y direction, vx0 and vy0 are the initial velocities in the x and y directions, and g=9.8ms2 is the acceleration of gravity.
Write code that uses a for loop to calculate the x and y-positions from 0 to 2s with t=0.1s and store them in arrays. Set vx0=vy0=10ms. Plot the x and y positions against one another to produce a curve like the one shown at the end of this problem.
2
Copy the code from above and paste it in the code cell below. Change your program so that the magnitude of the initial speed and its angle with respect to ground can be input by the user using an input prompt. Use the speed and angle to calculate the x and y-components of the initial velocity (i.e., calculate vx0 and vy0 rather than specify them). Use a while loop to calculate how the position of the projectile changes (x and y values) until it hits the ground (or is very close to hitting the ground). Again, plot the x and y positions against one another to produce a curve like the one shown at the end of this problem.
Copy and paste your code from above into the code cell below. Add code inside your while loop that calculates and stores how the velocity in the x and y direction changes with time.
Next, use quiver to add a few velocity vectors to your plot, so it looks similar to the one below. You should read MATLAB's documentation to learn how to use quiver. You will also need to use hold on and hold off. Galleries like this MATLAB plot gallery can also be helpful for figuring out how to make a particular type of plot.
Finally, add labels to the x and y axis and use xlim and/or ylim to improve the appearance of your plot.
 Problem 2: Let's make a plot that shows the vector velocity

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!