A single interface for defining differential equations and exporting to various formats.
Put deqn-mode.el where your emacs can see it, and put the following in your init.el
(require 'deqn-mode)
Add the following in a file with a .eqn extension, say model.eqn
drabbit = grass*rabbit - fox*rabbit # a differential equation is specified by prefixing the variable with a d
dfox = fox*rabbit - fox
rabbit = 100 # specify initial conditions without the "d" prefix
grass = 100 # specify values of parameters
fox = 3
If deqn-mode has been loaded, this text should be syntax highlighted.
Invoke the deqn mode hydra using C-c h
to see export options.
deqn-mode
provides export options to various formats, including:
- plain python - this provides an opinionated Model class, with helper functions to interact with the model
- PyDSTool - simple export to PyDSTool model definition along with some useful library imports
- SBML - export to the SBML format. This involves an intermediate plain text export to ease processing
- Plain text - separate files for parameters, initial conditions, and equation definitions
For each export option, the model file will be validated. If there are any parameters or initial conditions not specified, deqn-mode will throw an error. If everything is fine, the appropriate conversion scripts will be called.
Inspired from XPP, deqn-mode
provides some simple simulation capabilities directly from
the deqn model definition buffer. C-c h i
brings up the simulator interface transient
which allows the user to quickly control some features, and carry out a simulation.