scripts
Location: http://people.sc.fsu.edu/~jburkardt/classes/math1090_2020/scripts/scripts.html
MATLAB functions, programs and scripts:
-
dfield9,
a program which
allows a user to interactively specify the right hand side of an
ordinary differential equation (ODE). The program then displays
the corresponding direction field. If the user clicks on any point
in the image as an initial condition, the program displays the
corresponding solution curve. The original version of this code
was by John Polking.
-
double_pendulum_data.m,
data for the double pendulum problem.
-
double_pendulum_deriv.m,
evaluates the right hand side of the double pendulum system
of ODE's.
-
double_pendulum_energy.m,
returns the energy of a double pendulum system solution.
-
double_pendulum_movie_small.m,
sets up the small perturbation double pendulum problem,
and makes a movie of the solution.
-
double_pendulum_movie_small.avi,
a movie of the small perturbation double pendulum solution.
-
double_pendulum_test.m,
runs a simulation of the double pendulum problem.
-
euler.m,
a revised version of the forward Euler code, which can handle
systems of ODEs.
-
euler_one.m,
a forward Euler code to solve a differential equation.
It can't handle more than one equation, so we have replaced it.
-
expsin_exact.m,
evaluates the exact solution of the expsin test problem.
-
expsin_deriv.m,
the right hand side of the expsin test problem.
-
expsin_rk12_adapt.m,
uses RK12 adaptive ODE integration on the expsin problem.
-
expsin_rk12_error.m,
uses RK12 ODE integration to compare errors on the expsin problem.
-
flame_convergence_backward.m,
does a convergence study for the flame ODE with the backward Euler method (corrected version).
-
flame_convergence_euler.m,
does a convergence study for the flame ODE with the forward Euler method.
-
flame_deriv.m,
dydt=flame_deriv(t,y) defines the derivative associated with
the flame ODE.
-
flame_euler.m,
approximates the solution of the flame ODE using the forward
Euler method.
-
flame_euler_backward.m,
approximates the solution of the flame ODE using the backward
Euler method (corrected).
-
flame_exact.m,
y=flame_exact(t,delta) returns the exact solution of the
flame ODE at time t, with initial condition delta.
-
hump_deriv.m,
dydt=hump_deriv(t,y) defines the derivative associated
with the hump ODE.
-
hump_euler.m,
a script to test the Euler code with the hump_deriv function.
-
hump_rk4.m,
a script to test the RK4 code with the hump_deriv function.
-
kepler_conserved.m,
evaluates the conserved quantity for the Kepler ODE.
-
kepler_deriv.m,
defines the derivatives associated
with the Kepler ODE.
-
kepler_euler.m,
solves the Kepler ODE using euler().
-
kepler_midpoint.m,
solves the Kepler ODE using midpoint_fixed().
-
kepler_ode_test.m,
runs all the Kepler ODE solvers.
-
kepler_ode45.m,
solves the Kepler ODE using ode45().
-
kepler_ode_test.m,
calls kepler_euler, kepler_midpoint, kepler_ode45.
-
midpoint_fixed.m,
a midpoint "fixed-point" ODE solver.
-
pendulum_compare.m,
[t,u,v]=pendulum_compare(n) compares plots and energies for
three pendulum solutions using n steps.
-
pendulum_compare_plot.png,
plots three pendulum solutions using n steps.
-
pendulum_compare_energy.png,
plots the energy of three pendulum solutions using n steps.
-
pendulum_conserved.m,
the conserved quantity of the pendulum problem.
-
pendulum_deriv.m,
the right hand side of the pendulum problem.
-
pendulum_euler_backward.m,
[t,u,v]=pendulum_euler_backward(n) solves the pendulum ODE
using the backward Euler method.
-
pendulum_exact.m,
the exact solution of the pendulum problem.
-
pendulum_midpoint.m,
[t,u,v]=pendulum_backward(n) solves the pendulum ODE
using the midpoint method.
-
pendulum_rk4.m,
[t,u,v]=pendulum_rk4(n) solves the pendulum ODE
using a 4th order Runge-Kutta method.
-
pplane8,
a program which
allows a user to interactively specify the right hand sides of two
differential equations. The program then displays
the corresponding phase field. If the user clicks on any point
in the image as an initial condition, the program displays the
corresponding phase curve. The original version of this code
was by John Polking.
-
predator_conserved.m,
h=predator_conserved(rf) evaluates a conserved quantity for
the predator-prey ODE system.
-
predator_deriv.m,
duvdt=predator_deriv(t,rf) defines the derivatives associated with
the predator-prey ODE system.
-
predator_phase_euler.m,
predator_phase_euler(n) uses n equal Euler steps to create a plot
and phase plane for the predator-prey ODE system.
-
rk1.m,
the Euler method, written as a Runge Kutta ODE solver.
-
rk12.m,
the Euler/Heun methods, written as a pair of Runge Kutta ODE solvers,
returning an error estimate.
-
rk12_adapt.m,
the Euler/Heun methods, written as a pair of Runge Kutta ODE solvers,
using an adaptive stepsize.
-
rk2.m,
the Heun method, written as a Runge Kutta ODE solver.
-
rk4.m,
a fourth-order Runge-Kutta ODE solver.
-
sphere_deriv.m,
the right hand side of the sphere problem.
-
sphere_euler.m,
solve using Euler's method.
-
sphere_midpoint.m,
solve using the midpoint method.
-
sphere_ode45.m,
solve using ode45().
-
sphere_rk4.m,
solve using Runge Kutta 4.
-
stiff_convergence.m,
does a convergence study for the stiff ODE with the Euler method.
-
stiff_convergence_backward.m,
does a convergence study for the stiff ODE with the
backward Euler method.
-
stiff_deriv.m,
dydt = stiff_deriv(t,y) evaluates the right hand side
of the stiff problem.
-
stiff_euler.m,
uses n equal steps of the (forward) Euler method to solve
the stiff problem.
-
stiff_euler_test.m,
stiff_euler_test(n) calls stiff_euler(n) and plots the result.
-
stiff_euler_backward.m,
uses n equal steps of the backward Euler method to solve the
stiff problem.
-
stiff_euler_backward_test.m,
stiff_euler_backward_test(n) calls stiff_euler_backward(n)
and plots the result.
-
stiff_exact.m,
y = stiff_exact(t) evaluates the exact solution of the stiff problem.
-
stiff_midpoint.m,
uses n equal steps of the midpoint method to solve the stiff problem.
-
stiff_midpoint_test.m,
stiff_midpoint_test(n) calls stiff_midpoint(n) and plots the result.
Images:
-
flame_convergence_backward.png,
a convergence plot for the backward Euler method on the flame problem.
-
flame_convergence_euler.png,
a convergence plot for the Euler method on the flame problem.
-
hump_plot_euler.png,
a plot of the solution to the hump problem.
-
hump_plot_rk4.png,
a plot of the solution to the hump problem.
-
predator_phase.png,
a phase plot of predator/prey problem.
-
predator_plot.png,
a time plot of predator/prey problem.
-
rk4.m,
a fourth order Runge Kutta ODE solver.
-
sphere_conserved.m,
evaluates the conserved quantity for the sphere problem.
-
sphere_deriv.m,
the right hand side of the sphere problem.
-
sphere_euler.m,
solve using Euler's method.
-
sphere_midpoint.m,
solve using the midpoint method.
-
sphere_ode_test.m,
runs all the sphere ODE solvers.
-
sphere_ode45.m,
solve using ode45().
-
sphere_rk4.m,
solve using Runge Kutta 4.
-
stiff_convergence_backward.png,
a convergence plot for the backward Euler method on the stiff problem.
-
stiff_euler.png,
a plot of the solution from the Euler method on the stiff problem.
-
stiff_euler_backward.png,
a plot of the solution from the backward Euler method on the stiff problem.
-
stiff_midpoint.png,
a plot of the solution from the midpoint method on the stiff problem.
Last revised on 23 March 2020.