To do: Complete the tasks requested below. For this homework, you may not use any pre-built...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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). 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).
Expert Answer:
Answer rating: 100% (QA)
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... View the full answer
Posted Date:
Students also viewed these programming questions
-
For this homework you will be making a maze solver. Your program will take in from a file 2 things. The size of the square maze, and the maze itself. The maze will consists of numbers between 0 and...
-
Before attempting this project, be sure you have completed all of the reading assignments, hands-on labs, discussions, and assignments to date. Design a Java class named Guitar that contains: A...
-
If Vx = 6.80 units and Vy = 7.40 units, determine the magnitude and direction of V.
-
Suppose you want to buy a house that is sold by way of a first-price sealed bid auction. In contrast to the model in the lecture, there are more than 2 players. Players simultaneously and...
-
Calculate the average for each Temp level and the Temp effects for the Popcorn data. Identify these effect sizes on the main effects plot.
-
What is Robotic Process Automation (RPA) and in what type of work environment is it most effectively used?
-
For what types of reason does the marginal revenue product differ between workers in different jobs?
-
1. A country has a comparative advantage if it has a lower ________ cost of producing a good 2. The terms of trade is the rate at which two goods can be ________ for one another. 3. Suppose a country...
-
For this game, complete the tree diagram below by calculating numeric values for the probabilities along the labelled branches (large bold text), and the overall probability of winning P4 All...
-
T2125 - part 3B - line 3H - part 3C - line 8299 - part 4 - line 4A (all same value) Answer: Question 2 *BONUS T2125 - part 7 - line 7H subtotal of business-use-of-home expenses Answer: Question 3...
-
Four years from now you hope to buy your dream car. Today, that car costs $54,500. You expect the price to increase by an average of 3.1 percent per year over the next four years. How much will your...
-
What are the three important elements of asset valuation?
-
How does opportunity cost affect an investors required rate of return?
-
What are some important features of a bond? Which features determine the cash flows associated with a bond?
-
Give specific examples of systematic and unsystematic risk. How many different securities must be owned to essentially diversify away unsystematic risk?
-
Why would a convertible bond increase much more in value than a bond that is not convertible?
-
The U.S. automotive manufacturers have complained about Japanese automotive imports and that the U.S. car firms are locked out of the Japanese market. The Japanese have countered that the U.S. firms...
-
What is the back work ratio? What are typical back work ratio values for gas-turbine engines?
-
Prove from Fermat's Principle that the angles of incidence and reflection are equal for light bouncing off a mirror. Use neither algebra nor calculus in your proof! (Hint: The result was proven by...
-
An ideal converging lens focusses light from a point object onto a point image. Consider only rays that are straight lines except when crossing an air-glass boundary, such as those shown in the...
-
Light focusses onto a point I from a point \(\mathrm{O}\) after reflecting off a surface that completely surrounds the two points, as shown in cross section below. The shape of the surface is such...
Study smarter with the SolutionInn App