Practical Programming and
Numerical Methods
2021.
[
./pmwiki |
./lectures |
./exercises |
./homeworks |
./examples |
../repos |
homepage 2019 |
homepage 2020
]
new →
[examination projects]
← new
[Zoom: https://aarhusuniversity.zoom.us/j/4106164110]
- NB
-
- Schedule
-
F | Onsdag | 8 - 11 | Auditorium D2 (1531-119) | uge 5-12, 14-20 | |
F | Fredag | 13 - 16 | Auditorium D1 (1531-113) | uge 5-12, 14-20 | |
-
Plan
-
-
Introduction.
[→]
POSIX (UNIX) systems;
Programming languages for scientific computing;
Open software.
-
Code repositories. Makefiles.
[→]
Distributed version control systems; Code repositories;
hg
and git
;
POSIX make
utility for managing projects.
-
Basics of C programming.
Structure of a C-program, main function;
preprocessing, compiling and linking;
basic types
int
char
double
complex
long double
;
scope of variables (file, function, block);
simple output with printf
function;
mathematical functions and complex numbers.
-
More C programming.
Conditional
if else
and loops
for, while, do
;
Pointers;
Arrays;
Memory allocation/deallocation with malloc/free
;
Structs;
-
Input/output.
Standard streams, redirections, piping; file streams;
command-line arguments.
-
GNU Scientific Library. Scientific plots with gnuplot/pyxplot/plotutils.
-
Passing functions as arguments to other functions.
Pointers to functions; function pointers as arguments; function
pointers in arrays and structures; pointers to functions with
parameters.
GSL integration routines.
-
Multiprocessing.
-
GSL vectors and matrices, BLAS. Printf debugging.
-
Making scientific reports with LaTeX;
LaTex basics, math, figures.
- Reading: chapters "Basics", "Document Structure", and
"Importing Graphics" in the
LaTeX wikibook.
- Exercise
"latex".
-
Interpolation 1
[chapter.pdf]
[Homework "interpolation"]
- Polynomial interpolation;
- Spline interpolation: linear, quadratic, cubic splines;
-
Interpolation 2
- Sub-splines; Akima (exam project) and Steffen interpolants;
- Rational function interpolation;
Barycentric rational interpolation; Berrut interpolant (exam project);
- Bilinear interpolation on a rectilinear 2D grid (exam project);
-
Linear equations
[chapter.pdf]
[homework "linear-equations"]
- Triangular systems, back/forward-substitution;
- QR-decomposition: modified Gram-Schmidt algorithm, Householder reflection algorithm, Givens rotation algorithm;
- LU-decomposition: Doolittle algorithm;
- Cholesky decomposition;
- Determinant of a matrix;
- Matrix inverse.
-
Ordinary least-squares problem
[chapter.pdf]
[homework "least-squares"]
- Least-squares problem;
- Least-squares solution with QR-decomposition;
- Ordinary least-squares fit; fit errors and covariance matrix.
-
Eigenvalue decomposition
[chapter.pdf]
[homework "eigenvalues"]
- Eigenvalues and eigenvectors; Eigenvalue decomposition;
- QR/QL algoritm;
- Jacobi eigenvalue algorithm;
- Rank-1 and Rank-2 updates of symmetric eigenvalue problem;
- Singular value decomposition;
-
Ordinary differential equations (ODE) - 1
[chapter.pdf]
[homework "ODE"]
- One-step (Runge-Kutta) methods;
- Error estimate;
- Adaptive step-size strategy;
-
Ordinary differential equations (ODE) - 2
- Implicit, multi-step, and predictor-corrector steppers;
-
Numerical integration (quadratures) - 1
[chapter.pdf]
[homework "numerical integration"]
- Quadratures with equally spaced abscissas (Newton-Cotes quadratures);
- Adaptive algorithms with equally spaced abscissas;
-
A taste of C++: a vec class with operator overloading and garbage collection
[examples/c++/matrix]
-
Numerical integration (quadratures) - 2
- Quadratures with optimized nodes; Gauss and Gauss-Kronrod quadratures;
- Variable transformation quadratures; Clenshaw-Curtis quadrature;
-
Monte Carlo integration
[chapter.pdf]
[homework "Monte Carlo"]
- Plain Monte Carlo sampling; pseudo- and quasi-random (low
discrepancy) sequences
- Importance and Stratified sampling;
-
Nonlinear equations / root-finding
[chapter.pdf]
[homework "Roots"]
- Modified Newton's method with backtracking linesearch;
- Quasi-Newton methods: Broyden update;
-
Minimization
[chapter.pdf]
[homework "Minimum"]
- Modified Newton's method with backtracking linesearch;
- Quasi-Newton methods: Broyden and SR1 updates;
- Dowhill simplex method (Nelder-Mead);
-
Power methods and Krylov subspaces (linear algebra)
[chapter "Power methods"]
[chapter "Eigenvalues"]
- Power and inverse iteration methods;
- Arnoldi and Lanczos methods;
- GMRES (Generalized Minimum RESidual)
method for solving systems of linear equations.;
-
Artificial Neural Networks
[chapter "Artificial Neural Networks"]
[homework "Neural Network"]
- Artificial neurons and neural networks;
- Three-layer feed-forward neural networks; input, output, and hidden
neurons;
- Network training;
-
Fast Fourier transform and applications
[chapter "FFT"]
- Discrete Fourier Transform and applications
- Fast Fourier Transform: Danielson-Lanczos lemma and Cooley-Tukey algorithm;
-
Numerical methods for solving the Schrödinger (partial differential)
equation
- Finite difference method;
- Spectral method (basis expansion);
- Variational method;
- Spectral variational method;
- Artificial neural networks.
- References
-
D.V.Fedorov, Introduction to numerical methods,
[1M pdf file].
- C syntax
[→];
-
GNU Scientific Library documentation
[→];
-
Gnuplot documentation
[→];
-
Pyxplot user's guide
[→];
-
LATEX wikibook
[→];