Professional Documents
Culture Documents
Computational Methods
Parts 1–2
Chapters 1–7
Summary
All images copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
In-Class Test #1 – Thursday, Sept 30
4
Matrix Operations
Scalar Multiplication
Matrix Multiplication
5
Chapter 3: MATLAB Fundamentals
Input / Decision
M-files Loops
Output Structures
• Script • disp • if, elseif, else • for
• Function • fprintf • switch case • while
• Subfunctions • save
(nested) • load
• Anonymous
• In-Line
• Handles
6
Function Files
7
Algorithms Review
• Properties
Not Unique (many for a non-trivial task)
Devoid of Theory for the Instructions
Some Algorithms more Efficient than Others
Modified Often
• Principles for Creating an Algorithm
1. Solve a specific instance of the problem by hand
2. Generalize solution with variables
3. Execute the algorithm on several test cases
to verify that it produces correct answers
4. Write correct programming statements
to implement the general solution on a computer
9
Structured Programming
10
Chapter 4: Roundoff & Truncation
Errors
Roundoff
Other Uncertainty
Mistakes
11
Error Definitions
12
Total Numerical Error
13
Chapters 5–6: Roots
Root Finding
Methods
Newton-
Bisection
Raphson
False
Position 14
Graphical Methods
15
Bracketing Methods
• Bracketing Methods
– Can find a root more exactly
(up to a desired relative error)
– Require two initial estimates
which bracket the root
16
Open Methods
Golden
Section
Quadratic
1-D
Interpolation
fminbnd
Optimization
Methods
Contour
Graphical
Multi-
Surface
Dimensional
fminsearch
18
Equations to Memorize
19
Sample Test Questions
20
Sample Question #1
A. True
B. False
21
Sample Question #2
⎡ 1 ⎤ ⎡ −1 ⎤
• Given ⎢ ⎥ ⎢ ⎥
a = ⎢ 2 ⎥, b=⎢ 0 ⎥
⎢⎣ 3 ⎥⎦ ⎢⎣ 1 ⎥⎦
What is the result of the operation c = a T
b = a '* b ?
A. c=2
⎡ −1 ⎤
B. c=⎢ 0 ⎥
⎢ ⎥
⎢⎣ 3 ⎥⎦
⎡ −1 0 1 ⎤
C. c = ⎢ −2 0 2 ⎥
⎢ ⎥
⎢⎣ −3 0 3 ⎥⎦ 22
Sample Question #3
Algorithmic Thinking...
D. cannot be tested
23
Sample Question #4
A. True
B. False
24
Sample Question #5
A. open
B. bracketing
C. random
D. graphical
25
MATLAB (2nd) Part
26
AOE 2074
Computational Methods
Part 3
Chapter 8
Linear Algebraic
Equations and
Matrices
http://www.youtube.com/watch?v=gUgyY16UWAM
PowerPoints organized by Dr. Michael R. Gustafson II, Duke University & edited by Dr. Robert A. Canfield, Virginia Tech
27
All images copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 8 Objectives
29
Matrix Notation
An m×n matrix
31
Square Matrices
32
Matrix Types
– Identity Matrix:
– Multiplication with
Identity Matrix:
– Matrix Inverse:
– Transpose
33
Matrix Inverse and Transpose
34
Matrix Operations
Matrix Multiplication
Matrices must be Conformal 36
Properties of Matrix Multiplication
• Matrix Multiplication is
– Non-commutative
– Distributive
– Associative
37