modelicares

Functions and classes to set up Modelica simulations and load, analyze, and plot the results

This module provides convenient access to the most important functions and classes from the submodules. These are:

There is also a local function:

modelicares.load(*args)

Load multiple Modelica simulation and/or linearization results.

This function can be called with any number of arguments, each of which is a filename or directory with results to load. The filenames or directory names may contain wildcards. Each path must be absolute or resolved to the current directory.

As many of the matching filenames will be loaded as possible. No errors will be given for files that cannot be loaded.

Returns:

  1. SimResList of simulations
  2. LinResList of linearizations

Either may be an empty list.

Example:

# Get the mean values of the first capacitor's voltage from two runs of
# the Chua circuit.
>>> sims, __ = load('examples/ChuaCircuit/*/')
>>> sims.sort()

>>> sims['C1.v'].mean()
[-1.6083468, 0.84736514]

# The voltage is different because the inductance is different:
>>> sims['L.L'].value()
[15.0, 21.0]