Utilities
The API for simulating models and converting models to simulation objects.
Winston plotting
wplot
Plot the simulation result with Winston (must be installed and loaded).
wplot(sm::SimResult, filename::String, args...) wplot(sm::SimResult)
Arguments
sm::SimResult
: the simulation resultfilename::ASCIIString
: the filenameargs...
: extra arguments passed toWinston.file()
If filename
is not give, plot interactively.
Returns
- A Winston object
DataFrames and Gadfly
convert(::Type{DataFrame}, x::SimResult)
Convert to a DataFrame.
Base.convert(::Type{DataFrames.DataFrame}, x::SimResult)
Arguments
x::SimResult
: a simulation result
Returns
::DataFrame
: a DataFrame with the first column as:time
and remaining columns with simulation results.
plot
Plot the simulation result with Gadfly (must be installed and loaded).
plot(sm::SimResult, args...)
Arguments
sm::SimResult
: the simulation result
Returns
- A Gadfly object
Miscellaneous
@unknown
A macro to ease entry of many unknowns.
@unknown a1 a2 a3 ...
Arguments
a
: various representations of Unknowns:symbol
: equivalent tosymbol = Unknown()
symbol(val)
: equivalent tosymbol = Unknown(symbol, val)
symbol(x, y, z)
: equivalent tosymbol = Unknown(x, y, z)
For `symbol(
Effects
Creates one or more Unknowns
check
Prints the number of equations and the number of unknowns.
name(x)
Arguments
x
: a Model, EquationSet, or Sim
Returns
::Void