**spring_sweep_ode**,
a MATLAB code which
computes a grid of solutions to a parameterized system of
ordinary differential equations (ODE) that represent
the motion of a spring with mass m, damping b, and stiffness k.

Consider the parameterized second order differential equation:

m x'' + b x' + k x = 0which represents the behavior of a spring mass system with a mass of

We now suppose that we are interested in properties of the solution **x(t)**
over the time interval from 0 to 25 seconds, as we vary the physical properties
**b** and **k**. In particular, we would like to know the maximum value
of **x(t)** over the time interval for each choice of the physical parameters.

To answer this question, we must solve the ODE for each choice of the parameters.

The basic function has the form:

function peakVals = ode_fun ( bVals, kVals )where

- bVals is an array of B values;
- kVals is an array of K values;
- peakVals is an array containing the maximum value of the ODE solution for each combination of B and K.

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

**spring_sweep_ode** is available in
a MATLAB version and
an Octave version and
a Python version.

matlab_ode, MATLAB codes which set up various ordinary differential equations (ODE).

- spring_deriv.m, returns the right hand side of the ODE.
- spring_parameters.m, returns parameters of the ODE.
- spring_peak_display.m, displays a contour plot of the results of the parameter sweep.
- spring_sweep.m, sets up the ODE over a range of parameter values.