Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This problem will introduce you the MATLAB (if you have not used it before). In this course we will use MATLAB in a limited fashion

This problem will introduce you the MATLAB (if you have not used it before). In this course we will use MATLAB in a limited fashion to give you a glimpse on how it is used to solve engineering problems. In your junior year, you will spend an entire semester in AEM 3101 becoming very proficient in using MATLAB for engineering modeling and simulation purposes. In this problem you will use MATLAB to accomplish the following tasks:

(a) Write a function rho2h.m which, given density () in slugs per cubic feet returns altitude (h) in feet above sea level (assuming a standard atmosphere).

(b) Make a plot of time versus density data for a rocket in flight. The data the you will plot is given in the m-script skeleton listed below. Time is in the vector t and density is in the vector rho. The point of this task is make sure you know how to generate professional looking plots using MATLAB.

(c) Use the function you developed in part(a) to generate a second plot of time versus altitude for the same rocket. To get you started, a skeleton of the m-script that will do this has been been provided below. Type it up in the MATLAB editor and save it as an m-script named aem2301_ps_pr_2.m. Then write a function rho2h.m and save it in the same directory you saved aem2301_ps_pr_2.m. Then run aem2301_ps_pr_2.m from the MATLAB command line. The result should be the two plots you are asked to make. The plots generated are going to very plain. You are expected to make them look more professional along the lines we discuss in class. Turn in the two plots and the listing of rho2h.m.

%======================================================================%

% m-script name: aem2301_ps_1_pr_2.m

% Programmer: Your name goes here

% Date created: Date you created this m-script

% Date last modified: Data of the last change to this m-script

%

% Description: This m-script plots time vs. density and time

% time vs. altitude for a rocket in flight %=======================================================================%

% Clear memory and work space

clear all;

close all;

clc;

% Time and density history for the launch and ascent of a rocket

t = [0 10 20 30 40 50 60 70 80 90 100];

% Time in seconds since launch rho = (1e-3)*[2.377 2.208 2.010 2.0624 2.1149... 2.1673 2.2197 2.2721 2.3246 2.3770 2.377];

% Density in slugs/ft^3

% Loop through t and density to calculate altitude

number_of_data_points = length(t);

for k=1:number_of_data_points h(k) = rho2h(rho(k));

% You will have to write this function rho2h(density);

end

% Plot

figures figure(1)

plot(t,rho,r-);grid on;xlabel(Time);ylabel(Density (slugs/ft^3));

figure(2)

plot(t,h,r-);grid on;xlabel(Time);ylabel(Altitude (ft)); %===============================================================================

***There is no equation given to implement the equation, you must create it.

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

2. Identify conflict triggers in yourself and others

Answered: 1 week ago