Sie sind auf Seite 1von 2

MATLAB Lab Practical Practice

Problem #1: Data File Processing


You are working with a large data file with multiple rows and columns of data. Using the file
lppractice1.dat on Canvas, write a MATLAB program (script m-file) with lines of code to accomplish
the following tasks:
1. Import the numeric data contained in the file into the workspace stored in a variable (using the
load function)
2. Create vectors for the individual columns of data
3. Determine the number of entries in a column of data
4. Loop through each position in your vector to do the following:
A. Build a vector representing time which corresponds to the sampling times for the entries
in the column of data from Step 2.
B. Count the instances of occurrence of specific events where column A is between 10 and
100 and column B is between 500 and 1000. Count only if all conditions are true.
C. Build two vectors for values that meet the criteria in Step 4B, one for column A values
and one for column B values.
D. Report the results of values stored in the vectors from Step 4C to the user in formatted
and identified output
5. Plot the data in the columns from Step 2 (column B on the y-axis, column A on the x-axis) and
add axes labels and a plot title

MATLAB Lab Practical Practice


Problem #2: Auto Open Parachute Analysis
Problem Statement
A parachutist jumps out of an airplane at a height of 1000 meters above ground. You are challenged
with developing a program which will open the parachute once the parachutist reaches terminal velocity.
Terminal velocity is reached when the magnitude of drag force equation (below) equals the force of
gravity. For the sake of easier modelling we will define terminal velocity occurring when the absolute
magnitude of acceleration is less than 0.05 . Your analysis should complete the calculations below
once at each time step and continue while height greater than zero. The time interval for each iteration
should be set to 0.01 seconds.
Initializations

Cd (human) = 1.1
Cd (parachute) = 1.5
area, A (human) = 0.7
area, A (parachute) = 15
mass, m = 90 kg
density (air), = 1.1

height, h (initial) = 1000 m


time, t (initial) = 0 s
time, t_step (interval) = 0.01 s
gravity, g = -9.81

velocity, v = 0

acceleration, a = -9.81

Equations
(1)

(2)

(3)

(4) v =

/ , with
_

, with Fdrag in N,

in kg/m3, A in m2, Cd is unitless, and v in

, with m in kg, g in ,

in N, and

in N

in N, m in kg, and a (acceleration) in

, with a in , t in s, and v in

(5) v (current) = v (previous) + v, all velocities in


(6) h =

, with v in , t in s, and h in m

(7) h (current) = h (previous) + h, all heights in m


Note: When terminal velocity is reached, both the area and coefficient of drag change (see
initializations above), but the rest of the drag force equation remains the same. Change area and
coefficient of drag using a selection structure inside the loop.
Outputs

Store height, velocity, and time in a vector


Plot height and velocity with respect to time on the same graph
Report terminal velocity ( ) Hint: maximum magnitude in vector of velocities
NOTE DO NOT USE Kinematic equations from your physics class

Das könnte Ihnen auch gefallen