Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 14: Wednesday, May 2
Summary
Error analysis and oating point
You should know about relative vs absolute error, forward error, backward
error, residual, and condition numbers. You should rememb
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 5: Wednesday, Feb 29
Of cabbages and kings
The past three weeks have covered quite a bit of ground. Weve looked at
linear systems and least squares problems, and weve discussed Gaussian
eliminat
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 5: Monday, Feb 27
Least squares reminder
Last week, we started to discuss least squares solutions to overdetermined
linear systems:
minimize Ax b 2
2
where A Rmn , x Rn , b Rm with m > n. We des
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 5: Wednesday, Feb 22
Least squares: the big idea
Least squares problems are a special sort of minimization. Suppose A Rmn
and m > n. In general, we will not be able to exactly solve overdetermin
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 4: Wednesday, Feb 15
A summary
From Monday, you should have learned:
1. Gaussian elimination can be seen as the computation of a matrix factorization P A = LU , where L is a unit lower triangula
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 4: Monday, Feb 13
Gaussian elimination in matrix terms
To solve the linear system
4 4 2 x1
2
4 5 3 x2 = 3 ,
2 3 3 x3
5
by Gaussian elimination, we start by subtracting multiples of the rst row
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 3: Wednesday, Feb 8
Spaces and bases
I have two favorite vector spaces1 : Rn and the space Pd of polynomials of
degree at most d. For Rn , we have a canonical basis:
Rn = spancfw_e1 , e2 , . . .
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 3: Monday, Feb 6
Subtle singularity
A square matrix A Rnn is called invertible or nonsingular if there is an
A1 such that AA1 = I . Otherwise, A is called singular. There are several
common ways
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 2: Wednesday, Feb 1
Use a routine, or roll your own?
The Matlab function fzero is a fast, reliable black-box root-nding algorithm based on a combination of bisection (for safety) and interpola
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 2: Monday, Jan 30
Overview
After this week (and the associated problems), you should come away with
some understanding of
Algorithms for equation solving, particularly bisection, Newton, seca
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 1: Wednesday, Jan 25
Binary oating point encodings
Binary oating point arithmetic is essentially scientic notation. Where in
decimal scientic notation we write
1
= 3.333 . . . 101 ,
3
in oating
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 1: Monday, Jan 23
Safe computing
If this class were about shooting rather than computing, wed probably start
by talking about where the safety is. Otherwise, someone would shoot themself in the
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 6: Monday, Mar 5
Iterative and Direct Methods
So far, we have discussed direct methods for solving linear systems and least
squares problems. These methods have several advantages:
They are gen
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 6: Wednesday, Mar 7
From Stationary Methods to Krylov Subspaces
Last time, we discussed stationary methods for the iterative solution of linear
systems of equations, which can generally be writt
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 7: Monday, Mar 12
Newton and Company
Suppose f : Rn Rn is twice dierentiable. Then
f (x + x) = f (x) + f (x)x + O( x 2 ),
where f (x) denotes the Jacobian matrix at x. The idea of Newton iterati
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 14: Monday, Apr 30
Introduction
So far, our discussion of ODE solvers has been rather abstract. Weve talked
some about how to evaluate ODE solvers, how ODE solvers choose time steps
in order t
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 13: Wednesday, Apr 25
The Runge-Kutta concept
Runge-Kutta methods evaluate f (t, y ) multiple times in order to get higher
order accuracy. For example, the classical Runge-Kutta scheme is
K0 =
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 13: Monday, Apr 23
Ordinary dierential equations
Consider ordinary dierential equations of the form
(1)
y = f (t, y )
together with the initial condition y (0) = y0 . These are equivalent to i
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 12: Wednesday, Apr 18
Adaptive error control
Last time, we discussed Simpsons rule for quadrature:
b
f (x) dx
I [f ] =
a
ba
(f (a) + 4f (c) + f (b) ,
6
c
a+b
2
Simpsons rule has a local error
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 12: Monday, Apr 16
Panel integration
Suppose we want to compute the integral
b
f (x) dx
a
In estimating a derivative, it makes sense to use a locally accurate approximation to the function aro
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 11: Wednesday, Apr 11
Truncation versus rounding
Last week, we discussed two dierent ways to derive the centered dierence
approximation to the rst derivative
f (x + h) f (x h)
.
2h
Using Taylo
Bindel, Spring 2012
Intro to Scientic Computing (CS 3220)
Week 11: Monday, Apr 9
Maximizing an interpolating quadratic
Suppose that a function f is evaluated on a reasonably ne, uniform mesh
cfw_xi n=0 with spacing h = xi+1 xi . How can we nd any local ma
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 10: Monday, Apr 2
Hermite interpolation
For standard polynomial interpolation problems, we seek to satisfy conditions
of the form
p(xj ) = yj ,
where yj is frequently a sampled function value f
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 9: Wednesday, Mar 28
Summary of last time
We spent most of the last lecture discussing three forms of polynomial interpolation. In each case, we were given function values cfw_yi d=0 at points c
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 9: Monday, Mar 26
Function approximation
A common task in scientic computing is to approximate a function. The
approximated function might be available only through tabulated data, or it
may be
Bindel, Fall 2012
Intro to Scientic Computing (CS 3220)
Week 7: Wednesday, Mar 14
Line search revisited
In the last lecture, we briey discussed the idea of a line search to improve
the convergence of Newton iterations. That is, instead of always using the
CS 3220 Spring 2010
Homework 1
Problem 1: Heath Computer Problem 1.3.
For (b), at a minimum, provide experimental results for double- and single-precision in
Matlab, plus one other device (perhaps a calculator, or maybe the Unix dc program).
Provide some
CS 3220 Spring 2010
Homework 2
Problem 1: A narrowing of Heath Exercise 1.14.
Compute the midpoints of the following intervals using each of the two formulas given in
the problem, using an IEEE quarter precision number system with = 2, p = 5, and
[L, U ]
function [] = phi_test(W, s,h ) %PHI_TEST Summary of this function goes here % Detailed explanation goes here [i j] = find(W); n = randi(length(i); i = i(n); j = j(n); % i, j are indices of a weight to check; % h is a step size (e.g. h = 1e4) Wp = W; Wp(i
function [phi, Ws, ss] = phi_sensitivity(W, s) %PHI_SENSITIVITY calculates the mean as well as the partials of phi % See http:/mathbin.net/89270 and http:/mathbin.net/89286 for full % derivation of the Ws and ss n = size(W, 1); % L* = (L+1) L_star = spdia