AbstractSystems
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.AbstractSystems.AbstractSystem
— TypeAbstractSystem
is a supertype of EPHS.Components.Component
(for primitive systems) and EPHS.CompositeSystems.CompositeSystem
(for systems composed of subsystems).
EPHS.AbstractSystems.EVar
— TypeEVar(box_path::DtryPath, port_path::DtryPath)
An EVar
represents an effort variable of a port. See XVar
for info about the fields box_path
and port_path
.
EPHS.AbstractSystems.FVar
— TypeFVar(box_path::DtryPath, port_path::DtryPath)
A FVar
represents a flow variable of a port. See XVar
for info about the fields box_path
and port_path
.
EPHS.AbstractSystems.Interface
— TypeThe interface of a system is basically a directory (see Dtry
) of ports. Hence, each port of an Interface
is addressed by its name (i.e. DtryPath
) and it has assigned to it a PortType
.
EPHS.AbstractSystems.PortType
— TypePortType(quantity::Quantity, power::Bool)
Next to its name (i.e. DtryPath
, see Interface
), a port is defined by its PortType
, see also Interface
.
Fields
quantity
: only ports with the same Quantity can be connectedpower
:false
means state port,true
means power port
State ports only have a state variable to share information about the given quantity, e.g. the amount of magnetic flux. Power ports additionally have a flow and an effort variable whose pairing yields the power that is exchanged via the port.
EPHS.AbstractSystems.PortVar
— TypePortVar
is a supertype for port variables. Its concrete subtypes are
EPHS.AbstractSystems.PowerVar
— TypePowerVar
is a subtype of PortVar
. Concrete subtypes of PowerVar
are
EPHS.AbstractSystems.Quantity
— TypeQuantitiy(quantity::Symbol, space::Symbol, iseven::Bool)
A Quantity
represents a physical quantity and is used to define a PortType
.
Fields
quantity
:Symbol
identifying the quantity, e.g.:momentum
space
:Symbol
identifying its state space, e.g.:ℝ
iseven
:false
means the quantity has odd parity w.r.t. time reversal transformation
EPHS.AbstractSystems.XVar
— TypeXVar(box_path::DtryPath, port_path::DtryPath)
A XVar
represents a state variable of a port.
Fields
box_path
: name of theEPHS.Patterns.InnerBox
or system to which the port belongsport_path
: name of the port itself relative to the box or system interface
Hence, the full path identifying the port is box_path * port_path
. Both parts are stored separately to prevent ambiguities.
EPHS.AbstractSystems.angular_momentum
— ConstantQuantity
representing a real-valued angular momentum
EPHS.AbstractSystems.charge
— ConstantQuantity
representing an electric charge
EPHS.AbstractSystems.displacement
— ConstantQuantity
representing a real-valued displacement
EPHS.AbstractSystems.entropy
— ConstantQuantity
representing an entropy
EPHS.AbstractSystems.magnetic_flux
— ConstantQuantity
representing a magnetic flux
EPHS.AbstractSystems.momentum
— ConstantQuantity
representing a real-valued linear momentum
EPHS.AbstractSystems.volume
— ConstantQuantity
representing a volume
EPHS.AbstractSystems.fillcolor
— Methodfillcolor(system::AbstractSystem) -> String
Returns the fillcolor of an EPHS.Patterns.InnerBox
, which is filled by the given system. The returned String
is a HTML hex color code.
EPHS.AbstractSystems.interface
— Methodinterface(system::AbstractSystem) -> Interface
Returns the Interface
of the given system.
EPHS.AbstractSystems.total_energy
— Methodtotal_energy(system::AbstractSystem) -> SymExr
Returns a symbolic expression for the total energy of the system.
EPHS.AbstractSystems.total_entropy
— Methodtotal_entropy(system::AbstractSystem) -> SymExr
Returns a symbolic expression for the total entropy of the system.