Professional Documents
Culture Documents
Introduction To Numerical Analysis
Introduction To Numerical Analysis
ECE 3340
Electrical and Computer Engineering
University of Houston
Dr. David Mayerich
Goals and Expectations
• Understand fundamentals of numerical methods
• Experience in implementation (C++ and Matlab)
• I want to give you a set of important numerical tools and
practical experience implementing them
• C/C++
• Know how to format and compile your own code
• Basics of Visual Studio
• Matlab
• Using the massive number of available Matlab functions
• Vectorizing your code
Recommended Textbooks
• R.W.
Hamming, Numerical Methods for Scientists and
Engineers
• Mathematical basis for numerical methods
• Short and precise explanations for different aspects of numerical
methods
• $14.00 on Amazon.com
• Programming Assignments
• Finding Zeros (C/C++)
• Scaled Partial Pivoting (C/C++)
• Random Numbers & Monte-Carl Methods (C/C++)
• The Kessel Run – Solving ODEs (Matlab)
Course Material
• Homework assignments
• Taken from class lecture (your notes) and similar math problems
• You’re encouraged to work together, but don’t hand in copied work
• Grading will not be harsh, but it will exist
• Programming Projects
• You are expected to work independently
• Document your code – average one line of comments / line of code
• Explain “why” in the comments, not “what”
• Exams – Material will be taken from:
• Homework assignments (often outside material, reading)
• Lectures
• Programming assignments (focus on algorithms, not code)
• A 5” x 8” crib sheet is allowed for the exam
About Me
• B.S. Computer Science – SWOSU (Oklahoma)
• Ph.D. Computer Science – Texas A&M University
• Beckman Fellowship – University of Illinois
• Background
• Computer Graphics, Visualization
• Biomedical Imaging, Microscopy, Spectroscopy
• High-Performance Computing, GPU Computing
• Personal
• video games, fencing, climbing
Research Interests
0.6
100µm
0.5mm
a.u.
0.0
𝒌
𝑑 𝜃
𝒑
Why numerical methods?
• Implementation depends on need and constraints
• high-level applications can use Matlab, external libraries
• low-level applications are under pressure – memory, speed,
architecture
• Most low-level implementations are simple
• algorithms are available
• mostly have to worry about implementation
• architecture, memory, precision, speed, discretization errors
• Representation
is limited – n bits allow values
• 1-bit: 0, 1
• 2-bits: 00, 01, 10, 11
• What do we mean by 8-, 32-, and 64-bit systems?
0.7
0.5
0.3 n=0
𝐽 𝑛 (𝑧)
n=1
0.1 n=2
n=3
n=4
-0.1
-0.3
-0.5
𝑧
“It is well known that a recurrence relation is numerically unstable in the direction in which the
function is decreasing. Successive values are computed as small differences between nearly equal
terms and all accuracy is soon lost.”
-A.R. Barnett, The Calculation of Spherical Bessel Functions and Coulomb Functions
Truncation Error
• Take a common Taylor series approximation:
∞ (2 𝑛+1)
𝑥
sin 𝑥=∑ (− 1)𝑛 where 𝑥 ∈ ℝ
𝑛 =0 ( 2𝑛+1 ) !
• error introduced by not completing the evaluation of a
series
• This error can usually be bounded:
x=3
15
x=3.5
10 x=4
x=4.5
5 x=5
0
1 2 3 4 5 6 7 8
Feedback Error
• error introduced when an iterative algorithm takes a result
from one cycle and uses it in another
0.9
0.4
-0.1
-0.6
-1.1
7 Hz
10 Hz samples
Aliasing
0.9
0.4
-0.1
-0.6
-1.1
13 Hz
10 Hz samples
Aliasing
0.9
0.4
-0.1
-0.6
-1.1
3 Hz
10 Hz samples
Aliasing
0.9
0.4
-0.1
-0.6
-1.1
7 Hz
10 Hz samples
Aliasing
• How do we select the correct signal?
0.9
0.4
-0.1
-0.6
-1.1
7 Hz 3 Hz 13 Hz
10 Hz samples
Aliasing
• How do we select the correct signal?
• Applying a band limit eliminates high frequencies
0.9
0.4
-0.1
-0.6
-1.1
7 Hz 3 Hz
10 Hz samples
Aliasing
• How do we select the correct signal?
• Applying a band limit eliminates high frequencies
• Sample above the Nyquist limit: sample rate
0.9
0.4
-0.1
-0.6
-1.1
7 Hz 7 Hz 3 Hz
20 Hz samples
Aliasing
• How do we select the correct signal?
• Applying a band limit eliminates high frequencies
• Sample above the Nyquist limit: sample rate
0.9
0.4
-0.1
-0.6
-1.1
7 Hz
10 Hz samples
Image Aliasing
• Aliasing in images is very easy for humans to spot
• Problem in video games and visualization
• Apply the same technique: band limit (blur) the image
Image Aliasing
• Anti-aliasing techniques are often used in real-time graphics
• Human eye is highly sensitive to aliasing, so we trade
aliasing for noise (MSAA) or blurring (SSAA)
See Brasspup:
https://www.youtube.com/watch?v=uENITui5_jU