- Quiz 1
- Perform a cubic fit to the above data ( beware of the number of
points to be fitted) using both Cholesky method and QR method
- Email me with
- your Cholesky LS fit algorithm and dependencies
- your QR LS fit algorithm and dependencies
- in each case, a data file containing the parameters of the
fit and the RMS error of the fit,
- a quick note explaining the formula you used to calculate the
RMS error.
- Answers
- Cholesky method
- QR method
You have the choice
between the following two projects. The projects are due on Tuesday May
9th.
- Project 1: Write the equivalent of a
lecture on Singular Value Decomposition. Write it in a way that
is aimed towards your fellow class-mates. (i.e. do not try to show off
your knowledge but aim for a very clear and accessible exposition of
the subject). You should include discussions of the following topic:
- What is a Singular
Value Decomposition? How is
it related to an eigenvalue decomposition?
- Why is it a useful tool?
- What are the basic steps
of a typical SVD algorithm?
- How is it best used with
Least Square minimization?
- To illustrate the method,
and its use for Least Square minimization, use the SVD on the following
dataset. This involves:
- the DATA
- This dataset is the
Longley Dataset. It suggests that the number of employed people in the
US (y) is linearly related to
5 other variables, namely the GNP price deflator (x1) the
GNP (x2) , the number of unemployed people (in thousands) (x3), the
number in the armed forces (in thousands) (x4), the number of
non-institutionalized adults in the country (in millions) (x5).
- By considering each year
as one data point, perform a LS minimization using SVD to find the
coefficients of the theoretical fit
y = a0
+ a1
x1 + a2 x2 + a3 x3 + a4 x4 + a5 x5
- Perform the same LS
minimization with a Cholesky method and a QR method. From the SVD
obtained earlier, explain why the standard methods have stability
issues.
- Project 2: Write the equivalent of
a lecture on how an eigenvalue solver for matrices can also be used
towards finding eigenvalues and eigenfunctions of differential
operators by suitable expansion of the operator on a basis of known
functions.
- Introduce the problem by
considering the well-known Bessel eigenvalue equation
x
2 y'' + x y' + (k
2 x
2 -
n
2 ) y = 0 on the
interval [0,1] with y(0) = y(1) = 0
(this
can be physically derived from the 2-d wave equation on a circular
drum, for instance).
- Derive its eigenfunctions and eigenvalues analytically.
- Now consider instead a Fourier expansion of y, and show how
the problem can be transformed into finding the eigenvalues of an
infinite linear system.
- Truncate the Fourier series to order M, and implement the
resulting truncated eigenvalue problem numerically. Solve it using your
favourite routine for two fixed values of M (choose one to be fairly
small, and the other one to be large).
- Compare the values of the numerical eigenvalues to those
obtained analytically for both values of M
- Compare a few of the reconstructed eigenfunctions to those
obtained analytically for both values of M
- Discuss your results in terms of the "resolution" of the
Fourier expansion.
- Final
Project: due on Friday, June 16th.
- The final project description, together
with bcs, initial conditions and suggested tests is in the Lecture
notes page
- You should:
- Implement the equations numerically using
either a fully implicit solver or an ADI solver for the linear terms,
and any explicit method of your choice for the nonlinear terms
- The code MUST:
- be easy to read, and thoroughly commented
- compile on most machines (try it on a few
before sending it to me)
- be reasonably versatile (choice of
forcing, boundary conditions on Psi and initial conditions should be
left to the user)
- be reasonably well optimized (e.g.
Gaussian Elimination for the Poisson solver is not the favorite option).
- be reasonably fool-proof (make sure there
are warning flags if stability conditions are violated, etc..)
- Write a short report explaining
- The physical setup (you should already have all of this
from my notes)
- Precisely how the code works; you should
aim to write it as a "user manual", so that any person within this
AMS213 class can understand your code and use it themselves.
- What tests have you performed to ensure
that the results are correct. Imagine you are writing a paper and are
trying to convince the referee that your numerical scheme is a fair
representation of the true physical system.
- How would you go about estimating
numerical diffusivity for your algorithm
- and add to it
- a few examples of numerical experiments
you have performed, for varying initial conditions and varying
viscosity. In particular, you should aim to find the onset of
turbulence.
- If you are stuck and have failed to
achieve this, here are a few hints:
- your resolution needs to be at least
100x100, and the viscosity < 0.05 ( I am using 0.01 and even less
for very high resolution simulations)
- the most unstable modes are long
wavelength modes, so the onset of instability is easier to see for
large aspect ratio systems (try L=4 at least). If you set L = 4,
remember to use 4 times as many meshpoints in x than in y.
- don't be afraid to let the simulation run
for a while (the growth rate of the unstable modes can be long)
- try a forcing term such
that ubar = y2 (1-y)2
(1-2y) and set psi=0 on the top boundary.
- The results of the numerical simulations
can be added to the report as online material.
- Matlab can be used to create movies. If
you are stuck, I can give you a couple of scripts.