**spring_sweep_ode**,
a Python 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 MIT license

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

python_ode, Python codes which sets up various systems of ordinary differential equations (ODE).

- spring_sweep_ode.py, the source code.
- spring_sweep_ode.m, runs all the tests.
- spring_sweep_ode.txt, the output file.

- spring_sweep_ode.png, a surface plot of the data XMAX(B,K) computed by the program.