Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with writing a MATLAB program that can compute and plot the projectile path of the car and simulate the jump. I need

I need help with writing a MATLAB program that can compute and plot the projectile path of the car and simulate the jump. I need help on #17. and #18 part of the program. Here's my code so far and I've included how it should look like.

clc clear

%% Plotting projectile Path a = input('Enter the car jumping speed in miles per hour (mph): '); Meters = a.* 0.44704; fprintf('Meters per Second = %5.2f ',[Meters]) % Jump incline angle b = atand(1.5./7); fprintf('Jump incline angle = %5.2f ',[b]) Vx = Meters.* cosd(b); Vy = Meters.* sind(b); fprintf('Intial Vx = %.2f ',[Vx]) fprintf('Intial vy = %.2f ',[Vy]) % vy = vy0 +ay t ay = -9.81; t = -Vy./ay; fprintf('Time for the cars max height = %.2f ',[t]) % y = y0 + vy0t + 0.5 ay t2

ymax = 1.5 + Vy.*t + 0.5.*ay.*t.^2; fprintf('Max y height = %.2f ',[ymax])

t_fall = sqrt(-ymax./(0.5.*ay)); fprintf('Free fall time = %.2f ',[t_fall]) total_t = t + t_fall; fprintf('Total Flight Time = %.2f ',[total_t]) range = Vx.* total_t; fprintf('Total maximum range is = %.2f ',[range])

startval = 0; endVal = total_t; numberOfPoints = 100; c = linspace(startval, endVal, numberOfPoints); starval = 0; endval = 0; numbofpoints = 100; endvalue = 0; starttval = 0;

xarray = linspace(starval,endval,numbofpoints); yarray = linspace(starttval,endvalue,numbofpoints); % x = x0 + vx0t + ax t2 and y = y0 + vy0t + ay t2 xplot = xarray + Vx.*c; yplot = yarray + 1.5 + Vy.*c + (0.5).*(ay).*(c.^2); plot(xplot,yplot) xmin = min(xplot); xmax = max(xplot); ymin = min(yplot) ymaxx = max(yplot) % axis ([xmin, xmax, ymin, ymaxx]);

xcord = [0,7]; ycord = [0,1.5]; plot(xplot,yplot,xcord,ycord,'o'); xpark = [ 7, 7,7+16.2,7+16.2]; ypark = [ 0,1.5,1.5,0];

plot(xplot,yplot,xcord,ycord,'o',xpark,ypark,'--'); newxarray = linspace(starval+7,endval+7,numbofpoints);

topcar = [xcord,newxarray]; bottomcar = [ycord+1.5,yarray+1.5]; plot(xcord,ycord,'-',xpark,ypark,'--',topcar,bottomcar,'-.')

image text in transcribedimage text in transcribedimage text in transcribed

C o File C:/Users/harma/Downloads/Homework2_spring_2020.pdf Homework2_spring_2020.pdf 5/9 coordinates, and 7. Create another new variable to store the jump ramp y-direction coordinates, 0 and 1.5. 16. The tightly parked cars (for the race drivers to jump over) are 16.2 meters long and 1.5 meters high. Create a new variable to store the parked cars x-direction coordinates, 7,7, (7+16.2), and (7+16.2). Create another variable to store the parked cars y-direction coordinates, 0, 1.5, 1.5, and 0. 17. Use element-by-element addition to add the length of the jump ramp (7 m) to every value in the large array of x. This will offset the x-direction of the projectile coordinates by 7 meters to the right. Save the new x-direction projectile coordinates to a new variable. The y-direction projectile coordinates remain the same. 18. Now we are ready to prepare the coordinates for the top of the race car. The race car is 1.5 meters tall. The x-direction coordinates for the top of the race car can be obtained from combining the jump ramp x-direction coordinates and the new x-direction projectile coordinates together into a new array. The y-direction coordinates for the top of the race car can be obtained from combining the jump ramp y-direction coordinates + 1.5 and the new y-direction projectile coordinates + 1.5 together into a new array. 19. Plot the jump ramp, the tightly parked cars, the bottom of the race car projectile motion and the top of the race car projectile motion in the same figure. 20. Add an axis function to set the minimum x axis value to 0, maximum x axis value to 35, minimum y axis value to 0, and maximum y axis value to 25. + 1 U FIEL!/Users/harma/Downloads/Homework2_Spring_2020.pat 0 5 10 15 20 25 30 35 X (Another example command window and another example figure) Enter the car speed in MPH when the car jumps off the ramp: 45 The initial velocity is: 20.12 m/s The angle of the jump ramp is: 12.09 degrees The initial velocity in the x direction is: 19.67 m/s The initial velocity in the y direction is: 4.22 m/s Time to reach the maximum height is: 0.43 m The maximum height is: 2.41 m The time to fall from the maximum height is: 0.70 S The total fly time of the projectile is: 1.13 S + 1 U File L!/Users/harma Downloads/Homework2_spring_2020.pat plot to visually check the projectile shape and values. This plot will be modified later for part 2 15. (Part 2) The jump ramp is 7 meters long (measured horizontally) and 1.5 meters tall (measured vertically). Create a new variable to store the jump ramp x-direction coordinates, 0 and 7. Create another new variable to store the jump ramp y-direction coordinates, 0 and 1.5. 16. The tightly parked cars (for the race drivers to jump over) are 16.2 meters long and 1.5 meters high. Create a new variable to store the parked cars X-direction coordinates, 7, 7, (7+16.2), and (7+16.2). Create another variable to store the parked cars y-direction coordinates, 0, 1.5, 1.5, and 0. 17. Use element-by-element addition to add the length of the jump ramp (7 m) to every value in the large array of x. This will offset the x-direction of the projectile coordinates by 7 meters to the right. Save the new x-direction projectile coordinates to a new variable. The y-direction projectile coordinates remain the same. 18. Now we are ready to prepare the coordinates for the top of the race car. The race car is 1.5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions