This preview shows page 1. Sign up to view the full content.
Unformatted text preview: CEE 3804: Computer Applications in Civil Engineering Spring 2011 Assignment 7: Simulink and Modeling Systems
Solution Instructor: Trani Problem 1
Your task is design an emergency exit ramp for a runaway truck. Figure 1 illustrates the situation. Figure 1. Emergency Exit Ramp.
The truck has a mass of 40,000 kg. and enters the ramp at a speed of 42 m/s (~80 mph) while on a 5% grade. The ramp is
constructed in two segments: a) curved section with a radius of 1000 meters and b) straight section with a grade of 15%.
neglecting the aerodynamic drag acting on the truck, a freebody diagram showing the forces acting on the truck are shown in
Figure 2. Figure 2. Free Body Diagram of Truck. CEE 3804 Trani Page 1 of 9 Define a common set notation to solve the problem. When the truck is going downhill, the gravity force helps accelerate the
truck. When is going uphill the gravity force helps slow down the motion. The fundamental equation of motion to describe the
deceleration of the truck on the exit ramp is: m dV
= − mg cos(δ )µ + mg sin(δ )
dt Here we adopt the nomenclature that when angle δ is positive (i,e., downhill) the term mg sin(δ ) will be positive and thus
opposite to the friction term. In this case, the gravity helps accelerate the truck. When going uphill δ is negative and the term
mg sin(δ ) is negative helping decelerate the truck. Task 1
Model the curved section of the road as either a series of line segments or by deriving an equation that relates the local grade of
the curve as a function of the path length along the curve.
The curved section is made of two segments: a) a downhill segment ( l1 ) and an uphill segment ( l2 ). The length of these
segments is easily calculated below: l1 = G1 ⎡ 2π R ⎤ −5
=
(1000 m ) = 50 meters
100 ⎢ (2π ) ⎥ 100
⎣
⎦ l2 = G2 ⎡ 2π R ⎤ 15
=
(1000 m ) = 150 meters
100 ⎢ (2π ) ⎥ 100
⎣
⎦ The total length of the curved segment is then 150 meters.
For the curved road of radius 1,000 meters the grade decreases at a rate of 1/1000 radians per meter (i.e., 0.05 radians in 50
meters for the first segment of the road). An equation that relates the local grade of the road with path length (s) is then, ⎛ dG ⎞
G ( s ) = G1 − ⎜
s
⎝ ds ⎟
⎠ G ( s ) = 0.05 − ( 0.001) s
⎛ dG ⎞
is the rate of change of the grade (in radians/meter) vs.path distance traveled (s), G1 is the initial grade of the
⎜
⎝ ds ⎟
⎠
road (in radians) and s is the path length along the curved section of the road in meters. verify this equation by examining the
value of G ( s ) when s = 200 meters ( G (200 ) = −0.15 radians). This equation can be discretized as a table function by
selecting values of grade vs. path distance. For example, if 10 segments are selected along the path, the values of G ( s ) are
where: shown in Table 1 in table lookup function. Path Length (m) Grade (Rad.) 0 0.0500000000000000 20 0.0300000000000000 40 0.0100000000000000 60 0.0100000000000000 CEE 3804 Trani Page 2 of 9 Path Length (m) Grade (Rad.) 80 0.0300000000000000 100 0.0500000000000000 120 0.0700000000000000 140 0.0900000000000000 160 0.110000000000000 180 0.130000000000000 200 0.150000000000000 Figure 3. Simulink Model to Model Runaway Truck. Equation Used to Relate Grade and
Path Length (s).
According to this model, 334.4 meters are needed to bring truck to a full stop at
the end of the hill. CEE 3804 Trani Page 3 of 9 Figure 4. Acceleration, Speed and Distance Proﬁles for Truck. Equation Used to Relate
Grade and Path Length (s). CEE 3804 Trani Page 4 of 9 Figure 5. Simulink Model to Model Runaway Truck. Table Lookup Function Used to
Relate Grade and Path Length (s). Figure 6. Lookup Table Values to Relate Grade and Path Length. Vector of Input Values
are Path Length. Table Data is the Grade in Radians. CEE 3804 Trani Page 5 of 9 Figure 7. Acceleration, Speed and Distance Proﬁles for Truck. Table Lookup Function
Used to Relate Grade and Path Length (s).
According to this model, 334.5 meters are needed to bring truck to a full stop at
the end of the hill. CEE 3804 Trani Page 6 of 9 Problem 2
An Excel file contains data for thousands of public airports in the U.S. A sample of the file is shown below. The file is called
airports_2011.xls. Task 1
Create a Matlab script and use the Matlab function xlsread to read the data file into a Matalb Cell Array. Rename the variables
with names that represent the data. The airport name is a 3letter code used by the FAA to name airports (column 1).
___________ Matlab Script ___________ % Script ﬁle for Task1 of Problem 2 (Assignment 7)
% Read the ﬁle using the xlsread command in Matlab
% reads numeric and text sections seperately
[num txt]=xlsread('airports_2011.xls');
% Deﬁne variables in the problem
header=txt(1,:);
% header is the ﬁrst row of the ﬁle read
txt(1,:)=;
airportID=txt(:,1);
name=txt(:,2);
state=txt(:,3); % erase the ﬁrst row of txt array
% airport id is the ﬁrst column of the txt variable
% airport name is the second column of the txt variable
% airport state is the third column of the txt variable % Extract other variables )passengers, latitude and longitude form the
% numeric array (num)
passengerPerYear=num(:,1);
latitude=num(:,2);
longitude=num(:,3); % passengers per year
%
% longitude (deg) ___________________________________ Task 2
Add to the script created in Task 1 code to estimate the number of airports in the state of Colorado. Use the string comparison
function in Matlab (strcmp). Repeat for the number of airport in the state of Virginia. CEE 3804 Trani Page 7 of 9 ___________ Matlab Script ___________ % Count airports in Colorado and Virginia
count=strcmp(state,'CO');
% count airports in Colorado
numAirportsInCO=sum(count);
% number of airports in Colorado
count=strcmp(state,'VA');
numAirportsInVA=sum(count);
disp(['Airports in the State of Colorado ', num2str(numAirportsInCO) ])
disp(['Airports in the State of Virginia ', num2str(numAirportsInVA) ])
___________________________________ Airports in the State of Colorado 44.
Airports in the State of Virginia 37. Task 3
Add to the script in Task 2 to plot the location of airports in the State of Colorado. Use the usamap.mat file provided. Label your
map as needed.
___________ Matlab Script ___________ % Script ﬁle for Task3 of Problem 2 (Assignment 7)
matchAirportsCO=strcmp(state,'CO');
% ﬁnds indices of airports in Colorado
index=ﬁnd(matchAirportsCO==1);
(optional step)
latCO=latitude(index);
longCO=longitude(index); % Extracts indices of airports in Colorado
% Saves latitudes of airports in CO
% Saves longitudes of airports in CO load usamap
h=plot(uslon, uslat,'k', longCO, latCO,'r *');
xlabel('Longitude (deg)')
ylabel('Latitude (deg)')
grid
___________________________________ CEE 3804 Trani Page 8 of 9 Figure 2. U.S. Map with Airports in the State of Colorado. Task 4
Find the total number of passengers boarding planes at airports in the state of Virginia.
___________ Matlab Script ___________ % Script ﬁle for Task 4 of Problem 2 (Assignment 7)
matchAirportsVA=strcmp(state,'VA');
indexVA=ﬁnd(matchAirportsVA==1); % Finds indices of airports in VA
% Extracts indices of airports in VA totalNumPssngr=sum(passengerPerYear(indexVA));
disp(['Total Passengers at Airports in the State of Virginia ', num2str(totalNumPssngr) ])
___________________________________ Total Passengers at Airports in the State of Virginia 4,448,500.
Note that IAD and DCA airports are considered to be in the District of Columbia for
some strange reason in the database. CEE 3804 Trani Page 9 of 9 ...
View
Full
Document
This note was uploaded on 01/01/2012 for the course CEE 3804 taught by Professor Aatrani during the Spring '07 term at Virginia Tech.
 Spring '07
 AATrani

Click to edit the document details