University of California, Berkeley
Department of Mechanical Engineering
Fall Semester 2008
Instructors: M. Frenklach, R. Horowitz
E7, Assignment 8
Assigned: Thursday, October 23, 2008
Due: 12:00 pm, Friday, October 31, 2008.
This assignment is an introduction to using plotting tools in
MATLAB
as well as an
introduction to linear algebra. As before, turn in the hard copy of your published file to
the drop boxes in Etcheverry 1109 and upload the soft copies of your script and your
functions (the Mfiles) to bspace. Do not forget to name your main Mfile as
lastname_firstname_SID_lab08.m
NOTE: Do not forget to display the contents of your userdefined functions using
the command
type.
MATLAB
commands
*
introduced in this assignment:
subplot,
semilogx,
logspace, meshgrid, mesh, contour, clabel, ezplot
1. The following equation gives the displacement
x
as a function of time ,
t
( )
2
()
s
in
1
t
xt
e
t
αω
ωα
−
=−
where the parameter
α
is the damping ratio and
ω
is the undamped natural frequency.
Using
1
=
and
1
.
0
=
, plot
x
vs
for 0
t
30
≤
≤
t
. Note: you should create a function
that takes ,
t
and
as inputs and returns
x
.
a) Add the labels
and
to the vertical and horizontal axis using the commands
ylabel
and
xlabel
, respectively.
'
'
x
'
'
t
b) Use the command
title
to include the title “SpringMassDamper Displacement
Time curve” to the graph.
c) Use the command
grid
to display gridlines and also, use the command
axis
to set
the
axis from 1 to 1 and the
axis from 0 to 40.
'
'
x
'
'
t
*
Please refer to
MATLAB
help to learn how to use the functions introduced in this assignment.
Assignment 8
E7
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentUniversity of California, Berkeley
Department of Mechanical Engineering
Fall Semester 2008
Instructors: M. Frenklach, R. Horowitz
d) Use the
subplot
command and create a 2
×
1 array of graphs in the Figure window.
The top graph should contain a plot of
for
)
(
t
x
15
.
0
=
α
and the bottom graph should
contain a plot of
for
)
(
t
x
3
.
0
=
. The graphs should be created for
30
0
≤
≤
t
and
1
=
ω
,
while the axes should be labeled as in (b).
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 Sengupta
 Mechanical Engineering, Elementary algebra, Berkeley Fall Semester

Click to edit the document details