Parsing input ODE system


Macro for creating an ODE from a list of equations. Also injects all variables into the global scope.

This macro accepts a sybolically written ODE system and generates an ODE structure instance:

ode = @ODEmodel(
    x1'(t) = -k1 * x1(t),
    y1(t) = x1(t)

The main structure that represents input ODE system.

Stores information about states (x_vars), outputs (y_vars), inputs (u_vars), parameters (parameters) and the equations.

This structure is constructed via @ODEmodel macro.

set_parameter_values(ode, param_values)


  • ode - an ODE as above
  • param_values - values for (possibly, some of) the parameters as dictionary parameter => value


  • new ode with the parameters in param_values plugged with the given numbers

Create Compartmental Model

linear_compartment_model(graph, inputs, outputs, leaks)

Input: defines a linear compartment model with nodes numbered from 1 to n by

  • graph - and array of integer arrays representing the adjacency lists of the graph
  • inputs - array of input nodes
  • outputs - array of output nodes
  • leaks - array of sink nodes


  • the corresponding ODE system in the notation of