Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please help me with problem 2? The code provided below is the code that needs to be modified so that problem 2 is

Can someone please help me with problem 2? The code provided below is the code that needs to be modified so that problem 2 is satisfied.

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 PURPOSE: To motivate the use of a function. Each Script file below is to be stand alone and should begin with clc and clear Problem 1 Based on the rocket code of pre-lab 9, write a script file firstname_lastname_lab9_probem1.m to: i) Ask the user to enter the values of the rocket mass m in lbs, engine force f in lbs, and the engine burn time b in seconds. In the input prompt strings specify that m is to be between 5 and 15 lb, f is to be between 50 and 500 lbs, and b between 5 and 20 seconds. Note that the numbers do not have to be integers Calculate the flight parameters of rocket velocity at engine shut down v_b, rocket altitude at engine shut down h_b, peak altitude h_p, and the time to peak altitudet_p. ii) ) Display (using fprintf) messages with values of the four variables calculated above, including the correct associated units. Problem 2 Based on the rocket code of pre-lab 8, write a script file firstname lastname lab9 problem2.m to: ) Calculate the altitude h from the time of launch to ground impact. Again ask the user to input the values as in Problem 1, and again use dt 0.1 S. i) Create the plot of h versus t in figure 2, add x and y labels, title, and a gridl

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

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions

Question

How does theta affect the options premium? State an example.

Answered: 1 week ago