Last updated at 10:12 PM on 04 Mar 2009
Subscribe to the
RSS feed for lecture podcasts.
This page provides learning objectives and other supplementary iformation to support lectures in ME 352 during Fall 2008. Lectures are presented in reverse chronological information, i.e. the most recent lecture is listed first.
A separate page lists the MATLAB programming constructs, built-in variables, and special values that you need to know.
Yet another page provides code snippets for some common procedures in MATLAB.
Lecture on 26 November 2008
Reading: Textbook pp 455 -- 468
Homework: Problem Set 8 is for extra credit
The first half hour of class was spent on Quiz 2.
My digital voice recorder shut itself off 5 minutes after the start of lecture. As an experiment I created a screencast of the lecture and demonstration for the least squares curve fitting.
Lecture on 20 November 2008
Reading: Textbook pp 396 -- 405, 407 -- 408
During class we worked the solution to problem 2 and 3 on this handout.
Lecture on 18 November 2008
Reading: Textbook pp 334 -- 341
I hacked together a quick solution to the in-class problem. See steam.m.
A more comprehensive solution is obtained with the following set of codes: demoSteamInterp.m, steamEnthalpy.m, steamInterp.m, and steamSystem.m.
Lecture on 13 November 2008
Reading: Textbook pp 308 -- 331. Slides from Chapter 7: #31 -- 54
Lecture on 6 November 2008
Reading: Textbook pp 293 -- 309
Chapter 7 contains a lot of information. Use it as a reference. Be sure you can perform vector and matrix computations manually and with MATLAB.
At the start of lecture I gave two demonstrations of the applications of
linear algebra. In the tennis racket animation I showed how a two-dimensional
representation of a tennis racket could rendered as a rotating object in three
dimensional space. Matrix multiplication is used to apply rotations to the
set of points that define the shape of the matrix. You can
download a zip archive
of the m-files for the animation. Unpack the zip archive and run the animation
by typing tennisAnimation at the command prompt.
The second demonstration showed a very simple finite element model of two-dimensional
trusses you can
download a zip archive
of the code and sample files for the truss model. Unpack the zip archive and follow the
instructions in the readMe.txt the or the truss.pdf file.
During the discussion of the midterm exam, I repeated Hamming's aphorism that "the purpose of computing is insight, not numbers". Here's a photo of the cover page of Hamming's book, with an inset of his pithy comment from the page following the cover. The frontmatter also has another nice idea attributed to Confucius.
Lecture on 30 October 2008
Reading: pp. 273 - 279
In the second half of the class I demonstrated how to use the built-in
fzero function to solve the pipe buckling problem. The
main program
findTubeDiameter.m
calls fzero, which calls
pipeLoadDeltaDia.m
which calls
beamPcr.m.
A more elegant solution is embodied in the findTubeD.m program which uses nested functions.
The flow of input and output data is represented in this diagram
Lecture on 28 October 2008
Reading: pp. 261 - 279
In the second half of the class I demonstrated how to use the built-in
fzero function. We used the equation from problem 6.21 in the
textbook.
The first step is to create a function (this time called damp.m) that evaluates the function.
function z = damp(xi) % damp Evaluate f(xi) function for optimum damping ratio. Problem 6-21 z = cos( 4*xi.*sqrt(1-xi.^2) ) + 1 - 8*xi.^2 + 8*xi.^4;
A main program,
(this time called findDamp.m),
was created to call fzero
function findDamp
% findDamp Use fzero to find optimum damping ratio. Problem 6-21
% --- Plot the f(xi) function to visually locate roots
xmin = 0; xmax = 1;
x = linspace(xmin,xmax);
plot(x,damp(x))
% --- Adjust options that control fzero. Options are (key,value)
% pairs. The key is always a string. The value may be another
% string or a numeric value. In the following, we set the
% 'Display' option to 'iter' (key = 'Display', value = 'iter'),
% which means that fzero will print the results of each iteration.
% The 'TolX' option is set to 5e-9 (key = 'TolX', value = 5e-9)
% to adjust the convergence tolerance on the size of the bracket
% to 5e-9.
opts = optimset('Display','iter','TolX',5e-9);
% --- Call fzero with an initial guess of 0.5 and the opts struct
% created by optimset. Evaluate f(xi) at the root returned by fzero
r1 = fzero('damp',0.5,opts)
fr1 = damp(r1);
% --- Call fzero with an initial guess of 0.9
r2 = fzero('damp',0.9,opts);
fr2 = damp(r2);
% --- Add '*' symbols to the plot where fzero found roots, and
% add a dashed horizontal line through f(xi) = 0
hold('on');
plot([r1 r2],[fr1 fr2],'r*',[xmin xmax],[0 0],'k--')
Lecture on 23 October 2008
Reading: pp. 253 - 261
bisect routine from the NMM Toolbox.Lecture on 21 October 2008
Reading: pp. 240 - 250, 253 - 261, skim pp. 250 - 253
Exploratory plotting of f(x) functions was demonstrated with the equation from problem 6.17 in the textbook.
The class was asked to rearrange the equation into the form f(x)=0. After an initial round of algebra, I asked the class to come up with alternative forms of f(x) that did not have x in a denominator.
After several students demonstrated correct algebraic rearrangement of the original equation, I asked the class which version of f(x) they wanted to work with first. They chose the following.
The f1(x) function is implemented in vectorized form in the myfun function. The demoFun function uses the myfun function to generate a vector of (x,f(x)) data pairs for plotting f(x) versus x.
The alternative rearrangement of the original equation is f2(x)
The f2(x) function is implemented in non-vectorized form in the wayfun function. The demoWay function uses a loop to call the wayfun function to generate a vector of (x,f(x)) data pairs for plotting f(x) versus x. The x in the denominator of f2(x) caused the scale of the plot to be large when the range of x values extended to near the origin.
Lecture on 16 October 2008
Reading: pp. 193 - 197, 199 - 200, 209 - 213
The first half of the class was Quiz 1
This blog post by bre pettis shows you how to use your fingers to count in base two:
Lecture on 14 October 2008
Reading: pp. 48 - 51, 101 - 105
fprintf statement to print strings and values stored in MATLAB variables..After Joel Rogers gave his presentation about the ASME HPV competition, I described the role of the ASME and the development of the Boiler Code. I got the facts wrong.
The ASME held its first meeting in November 1880. The Boiler code was published in 1914.
Refer to this page on the ASME web site for a Brief History of the ASME.
Lecture on 9 October 2008
Reading: pp. 105 - 127
Lecture on 7 October 2008
Reading: pp. 63-68, 85-86, 93-98
Lecture on 2 October 2008
Reading: pp. 63-68, 85-86, 93-98
The podcast of the lecture did not work. The record/pause buttons can sometimes be pressed accidentally when I put the recorder in my pocket. I suspect that happened.
The second half of the class was spent in the CADLAB (EB 325) working on some problems that should help prepare you to do the homework.
Lecture on 29 September 2008
Reading: pp. 15-25, 63-68, 85-86, 93-98
Podcast: [Part A] [Part B] [Part C]
All students will need to use MATLAB to complete the first problem set. You do not need to buy MATLAB because it is available on all the computers on the College network. To use those computers you must first activate your MCECS computer account by following these steps:
Refer to the New User Support Page for additional information.
Also consult the Schedule for the help desk
Chapter 1 provides an overview to numerical analysis and the structure of the book. This is useful background information. It would be helpful to reread this chapter about midway through the quarter when the vocabulary will have more meaning.
Chapter 2 describes how to use MATLAB to perform interactive calculations. Plotting is also covered in Chapter 2.
Chapter 3 describes how to write MATLAB programs. In this first lecture we only considered the task of encapsulating a few MATLAB statements in an m-file. In the next class we'll examine input and output parameters in more detail.
Students are expected to have completed the following tasks in preparation of class meeting #2: