Copyright 1995, Society for Mathematical Biology. Reprinted without permission

Society for Mathematical Biology, March 1995, Vol 8, Number 1.

Software Corner

by Bard Ermentrout

In this section of the newsletter, I generally mention free software packages and where to get them. Next issue, I will describe a number of places where one can get dynamical systems software and what sorts of machines will run it. But this issue, I want to describe a program that costs money but is probably of interest to anyone who models real biological systems complete with quantifiable data.

Many years ago when I was a postdoc at the NIH in the Mathematics Research Branch, if one wanted to solve differential equations, graph them and produce camera ready output for publication, the only game in town was a program called MLAB short for Modelling Laboratory. The program was developed by Gary Knott and Douglas Reece at the NIH and ran on the DEC 10 using the SAIL computer language. At the time, MLAB had one of the most robust integrators of differential equations, had extensive matrix manipulation capabilities and best of all a very good curve fitting algorithm.

Now, there are many mathematics software packages available that run on most common platforms. Among them are MATLAB, MathCAD, XMath as well as the computer algebra systems MAPLE, Mathematica, and MACSYMA. Many of them do what MLAB used to do, but still lack a nice means of finding parameters that will match a given model to data.

I was quite surprised to see that MLAB is still alive and well and is now available for PC compatibles, SGI Irixes, NeXT workstations, and SUN workstations. Knott and Barry Bunow and a host of other programmers have added many new features to MLAB, the program is quite stable, runs very quickly, and provides a simple way of developing, evaluating, and displaying mathematical and statistical models of data.

The interface is command driven and consists of an interpreter which reads lines of text. You can save everything you have typed and read it back later or write a standard ASCII text file with a list of commands that are executed in order. The number of features and functions is huge. The program is able to produce beautiful graphs in postscript that can be quite complex with a large variety of fonts, linetypes, and pointtypes. There can be multiple graphs and inserts of graphs all on the same page. As with many matrix based software packages, one works with arrays and can do all the usual matrix manipulations such as adding, subtracting, multiplying, inverting, and applying functions to the arrays. MLAB also has an astonishing array of statistical and mathematical functions (more than any other of this type of program that I have seen.)

The main reasons to use MLAB as opposed to other integrated numerical and mathematical analysis packages are (1) the curve fitting program which adjusts parameters to a model by minimizing the weighted sums of the pth powers of the absolute errors and (2) its very good and robust differential equation integrator. Most modeling projects involve solving sets of algebraic and differential equations and comparing the computed results to some set of experimental data. There are generally many "free" parameters in the models in that the user has only a ballpark idea of what they are. Optimizing the parameter set is tedious and at best an inexact science using traditional methods of changing the parameter and looking at the solutions. MLAB eliminates much of this uncertainty by allowing you to define a set of parameters that you want to vary. This is best illustrated by an example.


I want to model the postsynaptic potential of a cell to a brief pulse as a third order differential equation of the form:

x'''+a3 x''+a2 x'+ a1 x = heaviside(toff-t)

with x(0)=x'(0)=x''(0)=0. I have 25 data points at t=0,...,25 milliseconds and want to find values of a1, a2, a3 that best fit the data. The entire MLAB session and its output is shown below

   * fct x1't(t)=x2
   * fct x2't(t)=x3
   * fct x3't(t)=-a3*x3-a2*x2-a1*x1+.5*(1+sign(toff-t))
   * initial x1(0)=0
   * initial x2(0)=0
   * initial x3(0)=0
   * toff=.5
   * a3=1
   * a2=1
   * a1=.5
   * m=read(synapse.dat,30,5)
   * p col 1=m col 1
   * p col 2=m col 5
   * constraints q={a3>0,a2>0,a1>0}
   * fit(a3,a2,a1), x1 to p, constraints q
   final parameter values
    value           error          dependency    parameter
   1.12290855     0.01902977477   0.3592732092    a3
   0.4851544432   0.005585560329  .0153916987     a2
   0.113493197    0.001667126941  0.3537858909    a1
   13 iterations
   best weighted sum of squares = 7.651178e-03
   weighted root mean square error = 1.823897e-02
   weighted deviation fraction = 2.828779e-02
   R squared = 9.963341e-01
   no active constraints
One can then integrate the equations with these parameters and graph them against the data to see how well it fit. This is always the acid test to any fitting problem

MLAB has an enormous variety of statistical and mathematical functions (more statistical analysis than any of the other general mathematics programs that are available, such as Maple, Mathematica, and Matlab.) It is clearly built around modelling rather then exploring mathematics in general. For this reason, I recommend it highly. There is one major caveat and that is the price. For a workstation, the price is $3000 for a single user license. Compared to the programs mentioned above, this is quite high, However, no program that I have seen makes the exploration and fitting of mathematical models to experimental data as easy as MLAB. Thus, If your main interest in mathematical software is to analyze and simulate experimental systems, then you should have MLAB on your computer.

[Previous Document] [Back to CSI Home Page] [Next Document]
Send comments to: