Numerical Computing
Class Demos


Special: the following m files are often used in my programs (they help with the plotting format)

subaxis.m
parseArgs.m

Jan 15 - 19

MATLAB diary for 1/18/18 (illustrating floating point errors)
r.m function m-file for plotting (1-x)^8
s.m function m-file calculating the first n terms in harmonic series

Jan 22 - 26

exp2x.m function m-file plotting (exp(2x)-1)/x
MATLAB diary for 1/25/18 (illustrating bisection and newton methods)
bisect.m function m-file for bisection method
newton0.m function m-file for Newton's method (0th version)
newton1.m function m-file for Newton's method (1st version)
MATLAB diary for 1/29/18 (illustrating newton and secant methods)
newton.m function m-file for newton method
newton2.m function m-file for Newton's method (colebrook)
secant0.m function m-file for secant method (0th version)
combo.m function m-file for all three methods

Feb 5 - 9

MATLAB diary for 2/5/18 (illustrating vectors and matrices; also check accuracy of LU)
matrix0.m function m-file for solving no-name matrix equation
matrix1.m function m-file for solving no-name matrix equation (max'ing the RAM)
van.m function m-file for solving Vandermonde equation
MATLAB diary for 2/8/18 (check accuracy of LU and heuristic used for correct digits)

Feb 12 - 16

MATLAB diary for 2/12/18 (illustrate connection between condition number and error)
target.m function m-file for plotting solution ellipse
MATLAB diary for 2/15/18 (sample data sets; global poly interpolation; function interpolation)
data.m function m-file for data plots
dataL.m function m-file for data+interpolation plots
dataLL.m function m-file for data+5th poly interpolation plots
interpolate.m function m-file for Lagrange interpolation
runge.m function m-file for Lagrange interpolation of Runge function

Feb 19 - 23

MATLAB diary for 2/12/18 (piecewise linear interpolation)
dataPL.m function m-file for piecewise linear interpolation for data examples

Feb 26 - March 6

B spline plots and formulas
MATLAB diary for 2/26/18 (cubic spline interpolation)
dataS.m function m-file for cubic spline interpolation for data examples
nspline.m function m-file for natural cubic spline interpolation
MATLAB diary for 3/1/18 (interpolation examples)
interpolates.m function m-file for data interpolation (for Lagrane and natural cubic spline)
interpolatePL.m function m-file for piecewise linear interpolation
interpolatePL2.m function m-file for error using piecewise linear interpolation
interpolateCS.m function m-file for cubic spline interpolation (natural and clamped)
fspline.m function m-file for clamped cubic spline interpolation

March 5 - 9

MATLAB diary for 3/5/18 (composite midpoint integration example)
midpt0.m function m-file for composite midpoint integration example
MATLAB diary for 3/8/18 (composite trap, Simpson, and midpoint integration example)
trap0.m function m-file for composite trap and midpoint integration example
simp0.m function m-file for composite trap, Simpson, and midpoint integration example

March 19 - 23

Integration handout
MATLAB diary for 3/19/18 (composite 2-point Gauss integration example)
integrateS.m function m-file for composite 2-point Gauss, Simpson, and midpoint integration example
table6_6.m function m-file for Gaussian quadrature (no subinterval version) example
Differentiation handout
MATLAB diary for 3/22/18 (forward can centered differentiation examples)
forward.m function m-file for forward difference approximation example
fowardcentered.m function m-file for comparison of forward and centered difference approximations

March 26 - 30

MATLAB diary for 3/26/18 (euler method example)
euler0.m function m-file for euler method example
euler1.m function m-file for error using euler method

April 2 - 6

MATLAB diary for 4/2/18 (backward euler and trap method examples)
beuler0.m function m-file for backward euler example
trap00.m function m-file for trap method example
trap1.m function m-file for error using trap method, and both euler methods
MATLAB diary for 4/5/18 (RK4 examples)
rk4.m function m-file for RK4 example
errorIVP.m function m-file for plotting error using IVP solver example
IVP tables tables useful in derivation of IVP solvers

April 9 - 13

MATLAB diary for 4/9/18 (euler method example)
fig8_6.m function m-file for plotting error function surfaces
regress0.m function m-file for linear least squares (using normal equations or MATLAB's built-in commands)
MATLAB diary for 4/13/18 (steepest descent method)
sdm11.m function m-file for SDM when n=2

April 16 - 20

MATLAB diary for 4/16/18 (CGM examples)
cgm1.m function m-file for CGM when n=2
cgmE.m function m-file for error using CGM (using solution of Laplace's equation)
cgm2.m function m-file for comparing CGM with Cholesky
cgm.m function m-file for CGM
MATLAB diary for 4/19/18 (nonlinear regression and gradient based descent examples)
nregress1.m function m-file for nonlinear regression (original versus transformed)
amst.txt data used by nregress1.m
fig8_2.m function m-file for surface and countour plots
surf3d.m another function m-file for surface and countour plots
sdmS.m function m-file for nonlinear SDM
cgmS.m function m-file for nonlinear CGM

April 23 - 27

MATLAB diary for 4/23/18 (Nelder-Mead example)
nmm.m function m-file for Nelder-Mead method