Skip to content

amoghpj/deqn-mode.el

Repository files navigation

deqn-mode

A single interface for defining differential equations and exporting to various formats.

Example

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.

Export

Invoke the deqn mode hydra using C-c h to see export options. deqn-mode provides export options to various formats, including:

  1. plain python - this provides an opinionated Model class, with helper functions to interact with the model
  2. PyDSTool - simple export to PyDSTool model definition along with some useful library imports
  3. SBML - export to the SBML format. This involves an intermediate plain text export to ease processing
  4. 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.

Simulation

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.

About

For all your equation definition needs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published