Lectures
Lectures are listed on this page. Click on the lecture heading or the "Continue ..." link to get the full content for the lecture.
Compact List of lectures
- Three Main Ideas in ME 350
- Week 1 - Introduction
- Week 2 - MATLAB Functions and Applications in Data Analysis
- Week 3 - `fprintf`, `for` loops and `if` constructs
- Week 4 - `if` constructs and `while` loops
- Week 5 - Review user-defined functions; and introduction to root-finding
- Week 6 - Multiple roots and using `fzero`
- Week 7 - Linear Algebra Operations in MATLAB
- Week 8 - Solving Linear Systems in MATLAB
- Week 9 - Solving First Order ODEs in MATLAB
Excerpts of lectures, most recent first
Week 9 - Solving First Order ODEs in MATLAB
Learning Objectives
At the end of this class you should be able to
- Verify whether a given formula is the analytical solution to a first order ODE with a prescribed initial condition
- Algebraically rearrange a first order ODE into a format that can be
used by
odeEuler
or other MATLAB codes for solving ODEs - Use the
odeEuler
code to solve a first order ODE numerically. - Describe how the error in the numerical solution with Euler's method varies with stepsize,
Lecture Videos on YouTube
These videos cover the material that I present in class.
The screencasts were recorded last fall. The sound level during recording was too low, and I haven't been able to figure out how to fix that without re-recording the screencasts.
Download
Here are the slides for the first two videos
- Introduction to numerical solution of ODEs slides
- Euler's method slides
Week 8 - Solving Linear Systems in MATLAB
Learning Objectives
At the end of this class you should be able to
- Manually compute vector addition, vector multiplication and matrix-vector multiplication for modest size (say ) matrices and vectors
- Use MATLAB to check your manual calculations of vector addition, vector multiplication and matrix-vector multiplication
- Manually and with MATLAB compute vector inner products.
- Define the formula for, manually compute, and use MATLAB to compute the , and vector norms
By "manually" I mean using only a pencil and paper, no MATLAB, no Internet access, no textbook
Reading
Same as Lecture 7: Read Sections 6.1 - 6.3 (pp. 129-145) and section 6.6 - 6.6.2, (pp 152 - 153)
Look at the web pages in the Reference section of the class web site.
In MATLAB, type "help slash" or "doc slash" for additional information about the solution of linear equations.
Download
Download the lecture notes on solving linear systems
Download the lecture slides on solving linear systems and focus on these parts:
- Setting up the system of equations, slides 4-12
- Requirements for a solution, slides 13-21
- The backslash operator, slides 57-58
- Limits on the Numerical Solution to Ax=b, slides 59-64
- The matrix condition number, the residual, and rules of thumb, slides 72-78
You may want to review the slides on Gaussian Elimination (slides 22-56) We will let MATLAB solve the system and instead focus on (1) setting up the system correctly and (2) interpreting the results.
Week 7 - Linear Algebra Operations in MATLAB
Learning Objectives
At the end of this class you should be able to
- Manually compute vector addition, vector multiplication and matrix-vector multiplication for modest size (say ) matrices and vectors
- Use MATLAB to check your manual calculations of vector addition, vector multiplication and matrix-vector multiplication
- Manually and with MATLAB compute vector inner products.
- Define the formula for, manually compute, and use MATLAB to compute the , and vector norms
By "manually" I mean using only a pencil and paper, no MATLAB, no Internet access, no textbook
Reading
Read Sections 6.1 - 6.3 (pp. 129-145) and section 6.6 - 6.6.2, (pp 152 - 153)
Look at the web pages in the Reference section of the class web site.
Download
Download
From the linear algebra review slides (second item, above) focus on these parts:
- Vector inner product, slides 12-15
- Vector norms, slides 18-24
- Compatibility requirement of matrix-vector products, slide 40
- Row view of the matrix vector product, slides 42-44
Week 6 - Multiple roots and using `fzero`
Learning Objectives
At the end of this class you should be able to
- Write an m-file that uses an embedded function to find roots of
- Use
bisect
andfzero
interchangeably to find the roots of - Describe the differences in performance of
bisect
andfzero
. - Write an m-file function to find multiple roots of function (that has multiple roots).
Reading
The textbook discusses root-finding in two separate contexts. Newton's method is used as an example of a computational algorithm Chapter 2, section 2.7.1 and then again in Chapter 7, section 7.1 through 7.3 as a practical means of discussing function m-files. Please review those sections.
Root-finding as a generic numerical method is discussed Chapter 14, section 14.1.
Download
- Download Lecture slides on root-finding and study these slides:
- Slide 45 summarizing basic root-finding methods. Note, we did not cover Newton's method and the secant method, but you should be generally aware of these two methods.
- Slides 46 - 50 on
fzero
Week 5 - Review user-defined functions; and introduction to root-finding
Learning Objectives
At the end of this class you should be able to
- Recognize a local function in a m-file
- Write a local function in a m-file
- Recognize an embedded function in an m-file
- Write an embedded function in an m-file
- Describe how the
brackPlot
function is used to bracket the roots of . - Describe how the
bisect
function is used to find the roots of , given a bracket. - Write an m-file function that uses
brackPlot
andbisect
to find the roots of an function.
Reading
The textbook discusses root-finding in two separate contexts. Newton's method is used as an example of a computational algorithm Chapter 2, section 2.7.1 and then again in Chapter 7, section 7.1 through 7.3 as a practical means of discussing function m-files. Please review those sections.
Root-finding as a generic numerical method is discussed Chapter 14, section 14.1.
Download
- Download slides on user-defined functions and study slides 19-24
- Download Lecture slides on root-finding and study these slides:
- Slides 1 - 16 on the introduction and on bracketing
- Slides 23 - 27 on bisection
- Slides 28 - 31 on convergence criteria
Week 4 - `if` constructs and `while` loops
Learning Objectives
At the end of this class you should be able to
- Recognize the various forms of
if
-end
,if
-else
-end
andif
-elseif
-else
-end
constructs - Write the logical expressions necessary for
if
constructs andwhile
loop constructs - Use
if
constructs in MATLAB programs - Read and understand the logic of a
while
loop construct - Use
while
loops in MATLAB programs
Reading in 5th edition of textbook
- Chapter 2, pp. 64 - 76
- Chapter 8, pp. 179 - 191
Reading in 6th edition of textbook
- Chapter 2, pp. 64 - 72
- Chapter 8, pp. 179 - 188
Download
Week 3 - `fprintf`, `for` loops and `if` constructs
Learning Objectives
At the end of this class you should be able to
- Use
fprintf
to display text messages in the command window - Use
fprintf
for display formatted values of numeric variables in the command window - Write a
for
loop to traverse a vector - Recognize an
if
-end
construct (more practice later)
Reading
- Chapter 2, pp. 57 - 76
- Chapter 8, pp. 179 - 182
For a gentle introduction to fprintf
, try this
screencast by Robert Talbert.
Lecture Slides
Download
- Notes on Using
fprintf
- Large size image of Figure 1 in the "Using
fprintf
" notes. - Slides on the
fprintf
command - Slides on
for
loops - Slides on the
if
constructs
Week 2 - MATLAB Functions and Applications in Data Analysis
MATLAB
functions allow creation of reusable code that can be assembled
into larger and more complex analysis. Even if you are using relatively simple
analysis, your code will be easier to write and maintain if you use functions.
In this class meeting we will build skills with creating and using functions. Before getting into functions in detail, we will first review the basic numeric data types used in MATLAB: scalars, vectors and matrices. It's important to understand data types because functions are usually designed to accept specific types of variables as inputs and return specific types of variables as outputs.
Reading
The chapter sections are the same for the 5th and 6th edition of the textbook. There is a slight difference in page numbers in the reading from Chapter 7
- Chapter 2, pp. 33 - 51, which is a repeat from week 1 plus pp. 44 - 51
- Chapter 7, Sections 7.1 - 7.2.1, pp. 161 - 168 5th edition or pp. 161-171 in 6th edition:
Don't get hung up on the Newton's method script at bottom of p. 162. It uses programming constructs
while
,if
-else
-end
that we have not discussed yet. We will cover these constructs and it would be good to read and think about that code. At least, write and test thef.m
anddf.m
functions from the middle of page 162. Start reading carefully on page 163. - Chapter 9, pp. 197 - 205, 230 - 231: Sections 9.1.1-9.1.10, 9.8
The material from Chapter 7 focuses on the technical requirements of function input and output parameters. The material from Chapter 9 focuses on plotting.
Lecture Notes and Slides
- Summary of Vector variables and expressions
- slides on 2D plots
- Read slides 1 through 16 in the slides on user-defined functions
Week 1 - Introduction
Reading
Before class read the following sections of the textbook.
Sixth Edition:
- Chapter 1, pp. 1 - 16, 25 - 30
- Chapter 2, pp. 33 -40
Fifth Edition:
- Chapter 1, pp. 1 - 15, 26 - 31
- Chapter 2, pp. 33 - 42
The class meets in the computer lab, EB 325. Refer to the lab exercise for downloads and information related to our in-class activity for today.
Three Main Ideas in ME 350
ME 350 deals with three main ideas.
- MATLAB software
- Numerical methods
- Computational thinking
These ideas overlap and interact. As we study different problems during the term, the emphasis or perspective on the problem will shift between these three ideas.