Reference

EPHS.DirectoriesModule

Directories - the NonEmptyDtry and Dtry monads

A nonempty directory of Ts (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 Symbols, 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 Ts into a directory of Ts by grafting the trees stored at the leaves directly onto their respective parent nodes.

A (possibly empty) directory of Ts (Dtry{T}) is either empty or it is a nonempty directory of Ts. 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.

source
EPHS.SymbolicExpressionsModule

The 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.

source
EPHS.PatternsModule

The Patterns module defines interconnection Patterns, 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.

source
EPHS.SimulationsModule

The 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.

source