Functions to load and plot data from multiple simulation and linearization files at once
Load multiple Modelica simulation and/or linearization results.
Arguments:
locations: Input filename, directory, or list of these
Wildcards (‘*’) may be used in the filename(s).
Returns:
Either may be an empty list.
Example:
>>> from modelicares import *
# By file:
>>> multiload(['examples/ChuaCircuit', 'examples/PID'])
Valid: SimRes('...ChuaCircuit.mat')
Valid: LinRes('...PID.mat')
([SimRes('...ChuaCircuit.mat')], [LinRes('...PID.mat')])
# By directory:
>>> multiload('examples')
Valid: SimRes('...ChuaCircuit.mat')
Valid: SimRes('...ChuaCircuit2.mat')...
Valid: LinRes('...PID.mat')...
([SimRes('...ChuaCircuit.mat'), SimRes('...ChuaCircuit2.mat'), SimRes('...ThreeTanks.mat')], [LinRes('...PID.mat')])
Plot data from multiple simulations in 2D Cartesian coordinates.
This method simply calls simres.SimRes.plot() from multiple instances of simres.SimRes.
A new figure is created if necessary.
Arguments:
sims: Simulation result or list of results (instances of simres.SimRes)
suffixes: Suffix or list of suffixes for the legends (see simres.SimRes.plot())
**kwargs: Propagated to simres.SimRes.plot() (and thus to base.plot() and finally matplotlib.pyplot.plot())
The dashes sequence is iterated across all plots.
Example:
>>> from modelicares import SimRes, multiplot, saveall
>>> sims = map(SimRes, ['examples/ChuaCircuit', 'examples/ChuaCircuit2'])
>>> multiplot(sims, title="Chua Circuit", label='examples/ChuaCircuits',
... suffixes=['L.L = %.0f H' % sim.get_IV('L.L')
... for sim in sims], # Read legend parameters.
... ynames1='L.i', ylabel1="Current")
(<matplotlib.axes.AxesSubplot object at 0x...>, None)
>>> saveall()
Saved examples/ChuaCircuits.pdf
Saved examples/ChuaCircuits.png