Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I please get some help with problem 1? I have to use a function for this problem. The code below is the code that

Can I please get some help with problem 1? I have to use a function for this problem. The code below is the code that needs to be modified.

image text in transcribed

image text in transcribed

clc clear disp('ENGR15100 Prelab 9') disp('Your name here') disp(' ') %Run script file for rocket calculations rocket2h2 %rocket2h2.m % clc b=input('Enter desired burn time '); disp(' ') h_des=input('Enter desired height '); disp(' ') dt=.1; m=10; f=2000; g=32.2; %calculate constants v_b=(f/m-g)*b; h_b=0.5*(f/m-g)*b^2; h_p=h_b+v_b^2/(2*g); t_p=b+v_b/g; figure(2) %Begin calculating flight h=0; k=0; while h>=0 t=k*dt; k=k+1; if th_des %do-able! h=0; k=0; t=0; while h STEP 2: Using the functions created above solve again the problems of lab 9 step 1. You will be writing standalone script files for each problem so each should begin with clear and clc. Please use the usual file naming of firstname_lastname_lab9 step2_problem1.m etc., for each of the five problems Problem 1 i) Ask the user to enter the values of the empty rocket mass m, the engine force f, the engine burn time b, and the time step dt. Calculate the flight parameters of the rocket velocity at engine shut down v_b, altitude at engine shut down h _b, peak altitude h p, and the time of peak altitude t p. Use the same values you used in lab 8 for m,f,b and g- 32.2 Display (using fprintf) messages with values of the variables calculated above ii) Problem 2 i) Ask the user to enter the same parameters as above, and produce a plot of altitude h from the time of launch to ground impact i) Create the plot in figure 2, add x and y labels, title, and a grid Problem 3 i) Ask the user to enter the same parameters as in 1) and calculate the velocity v and altitude h of the rocket from the time of launch to ground impact. Use the same values as before. i) Create a two-row, one-column subplot in figure 3. Subplot one shows altitude h over time, while subplot two shows velocity v over time Problem 4 i) Add the additional input function get_h des to the list of input parameters and then determine the time at which h = 3000 on the way up. Use a FOR loop technique and the same rocket parameters as in 1) except use a time step dt = 0.1 sec Print an error message if h = 3000 ft is not reached Use fprintf to display the result ii) Problem 5 i) Add the additional input function get_h_des to the list of input parameters and thern determine the time at which h = 3000 on the way up. Use a WHILE loop technique and a time step dt = 0.05sec. Print an error message if h = 3000 ft is not reached Use fprintf to display the result ii)

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions