Numerical Methods for Calculus and Differential Equations
MA 3457/CS 4033
  B Term, 2009

M-Files



Filename Used in HW #
Description
census_demo.m
Demonstrates the behavior of interpolating polynomials on selected census data.
cubic_spline_demo.m
Demonstrates the behavior of cubic splines on a set of design data.
div_dif.m 4
Computes Newton divided differences.
div_dif_hermite.m 4
Computes divided differences for Hermite polynomial interpolation.
finite_difference_demo.m 2
Demonstrates the behavior of forward- and central-difference derivative approximations on specified functions.
interp_demo.m 4
Demonstrates the behavior of interpolating polynomials on selected functions and intervals.
mech_osc_demo.m
Demonstrates MATLAB's ode45, ode113, and ode15s on the mechanical oscillator initial-value problem.
mech_osc_fun.m
Evaluates the right-hand side of the mechanical oscillator ODE; called by mech_osc_demo.m.
ode45_examples.m

Gives three examples of ode45 usage. To use this, place the file in the directory in which you are using MATLAB, then type "edit ode45_examples.m" in the MATLAB command window. The file will appear in the editing window. It has three "cells" containing the examples. Click on the cell corresponding to the example you would like to run, then "evaluate" the cell (i.e., run the code in the cell).
pendulum_fun.m
Evaluates f(t,y) for the pendulum problem; called by unstable_soln_demo.m.
p_eval.m 4
Evaluates an interpolating polynomial in Newton form.
richardson.m 7
Performs a specified number of steps of Richardson extrapolation.
romberg.m 8
Performs a specified number of steps of Romberg integration.
runge_demo.m
Demonstrates the behavior of interpolating polynomials on the Runge function.
runge_spline_demo.m
Demonstrates the behavior of cubic splines on the Runge function.
stiff_demo_1.m
Implements the forward and backward Euler methods on the stiff ODE initial-value problem  y' = -1000*(y-t^2) + 2*t, y(0) = 0; prints out the maximum error over [0,1].
stiff_demo_2.m
Implements the forward and backward Euler methods on the stiff ODE initial-value problem  y' = -1000*(y-t^2) + 2*t, y(0) = 0; plots the maximum error over over [0,1] for a range of step values.
unstable_soln_demo.m
Demonstrates the instability of the solution of the pendulum initial-value problem theta'' + sin(theta) = 0, theta(0) = 0, theta'(0) = 2.