The DDE_SOLVER command creates Fortran 90 code that can be used with DDE_SOLVER_M, a Fortran 90 module created by S. Thompson and L. F. Shampine for solving differential delay equations.
Note: The zip file on the DDE_SOLVER web page contains two files: dde_solver_m.f90 and dde_solver_m_unix.f90. The filenames do not indicate a version number, but the contents of these files do occasionally change! As of early May, 2014, the first four lines of the file dde_solver_m_unix.f90 are
A Fortran 90 file that can be used with the DDE_SOLVER_M
module is created by the command
The command will create the file [name].f90, where [name] is the name of the vector field defined in vector_field_file.vf.
The vector field must have at least one delay expression.
demo |
If the option demo=yes is given, the file [name]_demo.f90
is created. This program uses the default initial conditions and parameter
values to generate a solution to the DDEs.
Default: demo=no |
The Mackey-Glass equation is $$x'(t) = -bx + \frac{ax(t-\tau)}{1 + x(t-\tau)^{10}}$$
Here is the Mackey-Glass vector field file: MackeyGlass.vf.
The files created by
To compile the demonstration program, I will use the gfortran compiler. (gfortran is easily installed in most Linux distributions. Another readily available Fortran compiler is g95. If you use g95, you may need to add the option -ffree-line-length-huge to the command; the lines generated by VFGEN often exceed 80 characters.)
First the DDE_SOLVER_M module must be downloaded and compiled. As of May 2014, there is a .zip file on the DDE Solver web page. It contains two files: dde_solver_m.f90 and dde_solver_m_unix.f90. These files are identical except for the 'end-of-line' convention. I will use dde_solver_m_unix.f90.
To compile the solver module:
To compile the demonstration program:
Here is a plot of the data generated by MackeyGlass_demo, after the stoptime
in MackeyGlass_demo.f90 was changed to 500:
This example has a state-dependent delay.
The DDE is
$$y'(t) = \frac{y(t) y(\ln(y(t))-1)}{t + 1}$$
$$y(t) = 1, \; t < 0$$
A vector field file for this system is
sdd.vf.
We create the Fortran 90 functions and demonstration program with the command
This is another example with a state-dependent delay. The DDE is $$y'(t) = \frac{y\left(y(t)-\sqrt{2}\right)}{2\sqrt{t+1}}$$ $$y(t) = 1, \; t < 0$$ A vector field file for this system is sddfn.vf. We create the Fortran 90 functions and demonstration program with the command