Reference
EPHS.Directories
— ModuleDirectories - the NonEmptyDtry
and Dtry
monads
A nonempty directory of T
s (NonEmptyDtry{T}
) is essentially a tree whose leaves hold values of type T
. Each value is addressed by the path from the root node to the respective leaf, given by a list of Symbol
s, see DtryPath
.
The monad unit sends a value of type T
to a tree consisting only of a leaf holding the value.
The monad multiplication flattens a directory of directories of T
s into a directory of T
s by grafting the trees stored at the leaves directly onto their respective parent nodes.
A (possibly empty) directory of T
s (Dtry{T}
) is either empty or it is a nonempty directory of T
s. The Dtry
monad is hence obtained by composing the NonEmptyDtry
monad with the 'Maybe monad'. The composition of the monads relies on a distributive law. Since subdirectories (subtrees) of a directory cannot be empty, the distributive law filters out any empty directories at the leaves, as they cannot be grafted onto their parent nodes.
This module implements directories as an immutable data structure. Subdirectories are stored in lexicographic order to ensure that two directories with the same set of paths (namespace) and the same associated values are equal.
The implementation supports simple access of subdirectories and values, pretty-printing, iteration, mapping, filtering, merging, etc.
EPHS.SymbolicExpressions
— ModuleThe SymblicExpressions
module provides a simple computer algebra system (CAS). The concrete subtypes of SymExpr
provide a mathematical syntax to symbolically represent the relations that define the semantics of primitive and composite systems.
EPHS.AbstractSystems
— ModuleThe AbstractSystems
module provides a common basis for the graphical syntax defined in EPHS.Patterns
and the semantics defined in EPHS.Components
and EPHS.CompositeSystems
. Specifically, the module defines system interfaces (see Interface
), an abstract type for concrete systems (see AbstractSystem
), and port variables (see PortVar
).
EPHS.Patterns
— ModuleThe Patterns
module defines interconnection Pattern
s, which provide a graphical syntax for expressing a power-preserving interconnection of finitely many subsystems into a single composite system. Since subsystems may again have yet simpler subsystems, patterns can be composed, i.e. hierarchically nested. Whenever the outer interface of a pattern matches a subsystem interface of another pattern, the patterns can be composed.
EPHS.Components
— ModuleThe Components
module defines the primitive systems: StorageComponent
s, ReversibleComponent
s, and IrreversibleComponent
s.
EPHS.CompositeSystems
— ModuleThe CompositeSystems
module defines CompositeSystem
s and provides the means to assemble them into systems of differential(-algebraic) equations, see DAESystem
and assemble
.
EPHS.Simulations
— ModuleThe Simulations
module provides the simulate
function to compute the time evolution of composite systems, starting from an initial condition. As an argument, the function takes a numerical method, such as midpoint_rule
. Based on the DAESystem
obtained from the CompositeSystem
, this method generates Julia code, which is then called in a time-stepping loop. Further, the module provides functionality for post-processing and plotting of the SimulationResult
, see evolution
and plot_evolution
.