Question
Program needed in Language: C The objective of the car jump competition is to drive over a 7 m long (horizontally) and 1.5 m high
Program needed in Language: C
The objective of the car jump competition is to drive over a 7 m long (horizontally) and 1.5 m high (vertically) jump ramp and jump over 9 cars parked tightly side-by-side, approximately 1.8 m x 9 = 16.2 m long distance. Car jumps utilize the slop of the ramp and fast speed to create a catapult effect that launch the car into the air at an angle like a catapult. Since the slop of the ramp is fixed, the distance of the jump will be determined by the velocity of the car when it jumps off the ramp. Car repairs can be time consuming and expensive. Write a MATLAB App Designer app using Graphical User Interface (GUI) to help the race driver to visualize the jump and simulate the result. Add an Axes to show a picture of the race car in GUI when the app starts. Add another Axes in GUI to plot the jump ramp and parked cars in GUI when the app starts. 1. 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. 2. 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. 3. Plot the jump ramp and the tightly parked cars. 4. Set XLim to [0 35]. Set YLim to [0 25]. 5. Add plot title, x-axis label, y-axis label, and legend to the plot. Add a Label in GUI to show the race driver the current car speed in MPH. The label should show 0 MPH when the app starts. Add a speedometer Gauge in GUI to show the race car in MPH. The gauge should point to 0 MPH when the app starts. Add a start Button in GUI for the race driver to click to start the simulation and to start speeding up the car. When this start Button is clicked, the app should: 1. Modify the picture of the race car to show another picture. 2. Increment the text shown in the car speed label by 1 MPH every 0.2 seconds (200 milliseconds). 3. Increment the gauge value by 1 MPH every 0.2 seconds (200 milliseconds). Add a Jump Button in GUI for the race drive to click when the car reaches the desired jump speed. When this Jump Button is clicked, the app should:
1. Stop the car speed increment of the text shown in the car speed Label.
2. Stop the increment of the Gauge value.
3. Take the current car speed value in MPH from the Gauge and use the value for the simulation computation.
4. Convert the car speed from miles per hour (mph) to meters per second (m/s).
5. Compute the jump ramp incline angle.
6. Compute the initial velocity of the car in the x and y directions (vx0 and vy0).
7. Compute the time it takes for the car to reach the maximum height (vy = 0) using vy = vy0 + ay t.
8. Compute the maximum height using y = y0 + vy0t + ay t2 .
9. Compute the time it takes for the car to free-fall (with zero initial velocity) from the maximum height to the ground, using y = y0 + vy0t + ay t2.
10. Compute the total flight time of the projectile, the time it takes for the car to reach the maximum height plus the time it takes for the car to free-fall from the maximum height to the ground.
11. Use the MATLAB linspace function to generate a large array of time that starts at 0 and ends at the total fly time with 100 equally spaced time points.
12. Compute a large array of x and another large array of y values by applying element-byelement computation to the large array of time.
13. 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.
14. 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.
15. Use element-by-element addition to add the length of the jump ramp (7 m) to every value in the large array of x projectile motion coordinates.
16. 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.
17. 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.
18. Set XLim to [0 35]. Set YLim to [0 25].
19. Add plot title, x-axis label, y-axis label, and legend to the plot.
20. Multiply the time it takes for the car to reach the maximum height by 2 to obtain the time the race car flies above 1.5 m.
21. Compute the horizontal distance the race car flies above 1.5 m using x = x0 + vx0t + ax t2 . Recall that ax = 0.
22. If the horizontal distance the race car flies above 1.5 m value is greater than 16.2: a. Modify the picture of the race car to show a successful picture.
23. Else: a. Modify the picture of the race car to show a crash picture.
24. End.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started