Answered step by step
Verified Expert Solution
Question
1 Approved Answer
To do: Complete the tasks requested below. For this homework, you may not use any pre-built MATLAB functions to replace calculations. You may use
To do: Complete the tasks requested below. For this homework, you may not use any pre-built MATLAB functions to replace calculations. You may use any trigonometric functions, as well as the length, and zeros functions if you wish. Be sure to use the proper naming convention for the script files (HW13_LastName). Develop a MATLAB script file which will determine the trajectory of a projectile as a function of time. The output of the program should be a table of: o Time o Horizontal location o Vertical location o Horizontal velocity o Vertical velocity o Total velocity o Maximum elevation which matches the table provided below (note: do NOT use the table function). The program should also determine maximum elevation. Assume frictionless flight (no aerodynamic drag). User inputs: o Units o Relevant gravitational value o Initial velocity o Launch angle (in degrees) o Time increment (in seconds) The relevant kinematic equations are (Hint: you may not need to use all of these equations): Where is acceleration, is displacement, is time, is final velocity, and is initial velocity. The horizontal distance can be found as, where is the initial velocity in the horizontal direction and is time. Additionally, the vertical distance can be found as, where is the initial velocity in the vertical direction and is the acceleration of gravity. The program should include all values so long as When the program is completed, the prompt and output should have the following format: When the program is completed, the prompt and output should have the following format: Please input the units being used (m or ft): m Please input the corresponding value for gravity: 9.81 Please input the initial velocity: 25 Please input launch angle in degrees: 45 Please input the time increment in seconds: .25 Trajectory Information x (t) y (t) vx (t) vy(t) v(t) 0.00 0.00 0.00 17.68 17.68 25.00 0.25 4.42 4.11 17.68 15.23 23.33 0.50 8.84 7.61 17.68 12.77 21.81 0.75 13.26 10.50 17.68 10.32 20.47 1.00 17.68 12.77 17.68 7.87 19.35 1.25 22.10 14.43 17.68 5.42 18.49 1.50 26.52 15.48 17.68 2.96 17.92 1.75 30.94 15.91 17.68 0.51 17.69 2.00 35.36 15.74 17.68 -1.94 17.78 2.25 39.77 14.94 17.68 -4.39 18.22 2.50 44.19 13.54 17.68 -6,85 18.96 2.75 48.61 11.52 17.68 -9.30 19.97 3.00 53.03 8.89 17.68 -11.75 21.23 3.25 57.45 5.64 17.68 -14.20 22.68 3.50 61.87 1.79 17.68 -16.66 24.29 The maximum recorded elevation is 15.91 m **Note: You must store the user inputs for units and use it in your output statement (aka the user must be able to enter any set of numbers or units they wish). Additionally, make sure that the maximum recorded elevation is the simulated elevation not a calculated elevation (meaning, the maximum elevation from your program may not be the actual maximum elevation of the projectile) Submission: Submit one m-file including the following: header (see syllabus); Short description of what the program does (in your own words); Descriptive comments for most lines (Should be specific and demonstrate that you understand what the code is doing and how); code properly suppressed (i.e. displaying results via fprintf() or a similar function).
Step by Step Solution
★★★★★
3.55 Rating (162 Votes )
There are 3 Steps involved in it
Step: 1
CODE A Matlab script file for projectile motion determine the position and velocity components for the duration of time the projectile is in flight also provide the max elevation for the projectile cl...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