Modelling

Modelling#

Modelling is a central part of of the OPynSim API. At a high-level, the API is designed around three classes with distinct roles:

When modelling with OPynSim, it’s important to understand this relationship, because the rest of the modelling API is built around it.

Typical Modelling Workflow#

Typical modelling workflows follow some combination of these steps:

  1. Import or create a opynsim.ModelSpecification.

  2. If required, modify the opynsim.ModelSpecification.

  3. Compile the opynsim.ModelSpecification to a opynsim.Model.

  4. Generate an initial opynsim.ModelState with opynsim.Model.initial_state().

  5. If required, modify the opynsim.ModelState.

  6. Use, or extract data from, the resulting opynsim.Model + opynsim.ModelState pair.

See Plot Model Output vs. Property for an example of this pattern.