Introduction to Scientific Computing#

License Website DOI

AMATH 301 covers numerical methods and programming skills needed to solve physical, biological, and engineering problems. Content is transcribed from MATLAB (originally taught in the course) to Python for open source reference. Taken in Sp20 with Dr. Craig Gin.

Note: Starred topics (*) are not covered in Sp20 but covered in previous years.

Root-Finding and Optimization#

Topic

Applications

Numerical Methods
Python Skills

Jupyter
Notebook

Online

Root finding algorithms

Solving function values

Bisection method
Newton’s method
scipy.optimize.root_scalar()

ipynb

html

Unconstrained optimization

Finding max and min of convex functions

Golden section search
Gradient descent
scipy.optimize.fminbound()
scipy.optimize.fmin()

ipynb

html

Constrained optimization*

Finding max and min of functions with constraints

Linear programming
Genetic algorithm
scipy.optimize.linprog()
scipy.optimize.differential_evolution()

ipynb

html

Curve fitting and interpolation

Fitting data
Interpolating between data

Sum of squared error
Sum of absolute error
Maximum absolute error
scipy.optimize.fmin()
scipy.optimize.curve_fit()
numpy.polyfit()
numpy.polyval()
scipy.interpolate.interp1d()

ipynb

html

Linear Algebra#

Topic

Applications

Numerical Methods
Python Skills

Jupyter
Notebook

Online

Matrix operations in python

Dot product
Norm
Matrix multiplication

@
numpy.linalg.norm()

ipynb

html

Solving linear systems
with direct methods

Solving linear systems repeatedly

Matrix inversion
LU decomposition
np.linalg.lu()
scipy.linalg.solve()

ipynb

html

Solving linear systems
with iterative methods

Solving sparse linear systems

Jacobi method
Gauss-Seidel method
numpy.linalg.eig()
numpy.linalg.eigvals()

ipynb

html

Singular value decomposition (SVD)
(Principle component analysis, PCA)

Dimensionality reduction
Image compression

SVD, PCA algorithm
scipy.linalg.svd()

ipynb

html

Numerical Calculus#

Topic

Applications

Numerical Methods
Python Skills

Jupyter
Notebook

Online

Numerical differentiation

Differentiate functions
Differentiate data

Forward difference
Backward difference
Central difference
Other second order methods
numpy.gradient()

ipynb

html

Numerical integration

Single integrals
Double integrals
Triple integrals
(functions and data)

Left end point rule
Right endpoint rule
Midpoint rule
Trapezoidal rule
Simpson’s rule
scipy.integrate.quad()
scipy.integrate.dblquad()
scipy.integrate.tplquad()

ipynb

html

Ordinary Differential Equations (ODEs)#

Topic

Applications

Numerical Methods
Python Skills

Jupyter
Notebook

Online

Solving first-order ODEs

Solving first-order ODEs

Forward Euler
Backward Euler
Midpoint method
Fourth-order Runge-Kutta (RK4)
scipy.integrate.solve_ivp()

ipynb

html

Solving higher-order ODEs

Solving higher-order ODEs
Systems of first-order ODEs

Forward Euler
Backward Euler
scipy.integrate.solve_ivp()

ipynb

html

Stability and stiffness of ODEs

Choosing integration methods
Choosing time steps

Forward Euler
Backward Euler
scipy.integrate.solve_ivp()

ipynb

html

Chaotic systems part 1*

Lorenz system

scipy.integrate.solve_ivp()

ipynb

html

Chaotic systems part 2*

Lorenz system

scipy.integrate.solve_ivp()

ipynb

html

Phase Portrait Applications#

Topic

Applications

Numerical Methods
Python Skills

Jupyter
Notebook

Online

Spring-mass-damper system

Physics

scipy.integrate.solve_ivp()

ipynb

html

Linear, nonlinear pendulum

Physics

scipy.integrate.solve_ivp()

ipynb

html

Two-eyed monster

Applied math

scipy.integrate.solve_ivp()

ipynb

html

Population dynamics
Predator-pray model
Competition model

Ecology

scipy.integrate.solve_ivp()

ipynb

html

FitzHugh-Nagumo neuron excitation model part 1*

Neuroscience

scipy.integrate.solve_ivp()

ipynb

html

FitzHugh-Nagumo neuron excitation model part 2*

Neuroscience

scipy.integrate.solve_ivp()

ipynb

html

FitzHugh-Nagumo neuron excitation model part 3*

Neuroscience

scipy.integrate.solve_ivp()

ipynb

html

Coupled harmonic oscillator*

Physics

scipy.integrate.solve_ivp()

ipynb

html

Fourier Transform#

Topic

Applications

Numerical Methods
Python Skills

Jupyter
Notebook

Online

Fourier transform*

Power spectrum density
Noise filtering
Image compression

Discrete Fourier transform
Fast Fourier transform
numpy.fft.fft()
numpy.fft.ifft()
numpy.fft.fftfreq()
numpy.fft.fft2()

ipynb

html