Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create Matlab script with following Screenshot and instructions HW 13 - Projectile Program To do: Complete the tasks requested below. For this homework, you may
Create Matlab script with following Screenshot and instructions
HW 13 - Projectile Program To do: Complete the tasks requested below. For this homework, you may not use any pre-built MATLAB The program should include all values so long as y 2 0. functions to replace calculations. You may use any trigonometric functions, as well as the length, and zeros When the program is completed, the prompt and output should have the following format: 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: 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 Time Horizontal location Trajectory Information Vertical location x (t) y (t) vx (t) vy (t) v (t) o Horizontal velocity o Vertical velocity Total velocity 0.00 25.00 23.33 0.00 0.00 17.68 17.68 0.25 4.42 4.11 17.68 15.23 8.84 13.26 12.77 10.32 0.50 7.61 17.68 21.81 0.75 10.50 17.68 20.47 Maximum elevation 1.00 17.68 12.77 17.68 7.87 19.35 which matches the table provided below (note: do NOT use the table function). 18.49 17.92 17.69 1.25 22.10 14.43 17.68 5.42 1.50 26.52 15.48 17.68 2.96 1.75 2.00 30.94 15.91 17.68 0.51 The program should also determine maximum elevation. Assume frictionless flight (no aerodynamic drag). User inputs: 35.36 15.74 17.68 -1.94 17.78 2.25 2.50 39.77 14.94 17.68 -4.39 18.22 Units 44.19 13.54 17.68 -6.85 18.96 2.75 48.61 11.52 17.68 -9.30 19.97 Relevant gravitational value Initial velocity Launch angle (in degrees) Time increment (in seconds) 8.89 5.64 3.00 53.03 17.68 -11.75 21.23 3.25 57.45 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 The relevant kinematic equations in the vertical direction are: **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) vy = (vo)y + ayt 1 y = yo + (Vo)yt + ayt? 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 v,? = (vo); + 2a,(y yo) code is doing and how); code properly suppressed (i.e. displaying results via fprintf() or a similar function). (Hint: you may not need to use all of these equations) Where ay is vertical acceleration, y is vertical displacement, t is time, v, is final vertical velocity, and (vo), is initial vertical velocity. On the earth's surface, a, = -32.2 :-9.81. or = The horizontal distance can be found as, x = xo + (vo),xt (vo)x = vx (In the x direction the initial and final velocities are equal.) where (vo)x is the initial velocity in the horizontal direction and t is time. Page 1/2 Page 2/2
Step by Step Solution
★★★★★
3.46 Rating (166 Votes )
There are 3 Steps involved in it
Step: 1
MATLAB Code taking input from user unit inputPlease input the units being used m or ft g inputP...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