The user interface, workflow and languages used by Magnolia have been designed specifically for the development and analysis of mathematical models based on differential equations.
Modeling Language Features
Magnolia uses a specialized language for specification of mathematical models: CSL (Continuous Simulation Language). This language include specialized operators and constructs for the development of models based on ODEs:
- Operators for specifying numerically integrated (explicit) states and related derivatives
- Language constructs for specifying under what conditions specific equations should be evaluated (CSL “sections”)
- Operators for generating a variety of waveforms and signals
- Language conventions for defining and enforcing quantities as model parameters (constants)
- Array and matrix (multi-dimensional vector) variables and constants
- Automatic sorting of equations comprising derivatives
- A robust facility for specifying discrete events, either time-based or state-based, and synchronizing discrete and continuous equations/statements
- Control flow constructs (loops and if/else statements)
- Non-floating-point data types: integer, logical, string
- A full set of basic arithmetic, logical and relational operators
- Special tokens to denote comments, line continuations, etc.
- Capabilities for composing models from reusable sub-models (experimental feature)
Scripting (CMD) Language Features
In addition to the Python language, Magnolia provides a easy-to-learn, yet flexible scripting language (CMD) providing the following capabilities:
- Set or display model parameters with a simple notation
- Create lists of variables to be output to screen or logged for later plotting at each simulation step
- Import data for plotting or parameter estimation from CSV files
- Plot trajectories of model predictions with a simple set of commands; set titles, axis ranges, independent variable, overlaid observed data, log/linear axis types
- Perform parameter estimation
- Perform Monte Carlo analyses
- Create reusable procedures for common scripting tasks
Scripting (Python) Language Features
As an alternative to the CMD language, Magnolia allows complex scripts for model control and analysis using the Python programming language. A complete reference for Python can be found on the Python website here, and short overview of how the Python language can be used with Magnolia models is presented in the Magnolia documentation here. In general, Magnolia models are represented in the Python environment by instances of Python classes; those classes provide methods for: setting or getting model parameters/variables and trajectories, executing a model, and constructing plots. We recommend users become familiar with the Magnolia modeling language and simple command-based scripting languages first, then approach Python-based scripting when the need for more complex analyses or data manipulation arises.
User Interface Features
Like the command and scripting languages used by Magnolia, the user interface and workflow is designed to facilitate the development, execution and analysis of ODE-based models.
- A “Folders” window which allows the local folders to be browsed, and model, script or data files to be opened in the Magnolia environment
- Full-featured code editors which provide color syntax highlighting and various other code-specific editing features for the languages used in Magnolia
- An “Alerts” window displaying a list of any errors or warning issued during build or execution of a model; clicking on an alert item in this window causes the specific offending line of code to be opened and displayed in the editor for quick troubleshooting and debugging of model code
- A “Command” window, used to interactively control the simulation using the Python language, or to output diagnostic information during compilation or runtime
- A “Command History” window containing a list of all commands issued since the application was started, useful for repeating lengthy or complex commands
- Interactive and static plot windows with configurable plot controls. Interactive plots provide lists of model outputs, constants and data sets, and the ability to specify lists of “sliders” that can be used to interactively adjust parameter values and watch model trajectories update in real time
- A “Spreadsheet” view, allow CSV data files to be opened, edited and plotted
Future (planned) Feature Implementation Status
The status of features which are either planned, or under development, are summarized below. Note that the table is roughly ordered by implementation priority, with entries at the top of the table having higher priority. If you have a suggestion or request for a feature not shown here, or have any comments regarding prioritization of features, contact us via email at team@magnoliasci.com.
Feature | Status |
---|---|
Plot exporting; export plot as an image file, or as CSV data | In Progress |
Remaining sections of documentation | In Progress |
Local file history; compare and revert to previous versions of local source files | In Progress |
Experimental SUBMODEL language features in CSL | In Progress |
Experimental "Analyst Mode" UI/features/workflow | In Progress |
DELAY operator for implementation of delay-differential equations | Planned |
GUI-based method for creating parameter estimation runs | Planned |
Local and global sensitivity analysis via Python | Planned |
GUI-based method for creating local and global sensitivity analyses | Planned |
MCMC capability via Python scripts | Planned |
GUI-based method for specifying MCMC models | Planned |
Implicit integration (IMPLC) operator | Planned |