CompositeSystems
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.CompositeSystems.CompositeSystem
— MethodCompositeSystem(junctions::Dtry{Junction{P}}, boxes::Dtry{InnerBox{AbstractSystem,P}}) where {P<:Union{Nothing,Position}}
A CompositeSystem
is given by a Pattern
, where each InnerBox
is filled by a system whose interface matches that of the box.
EPHS.CompositeSystems.Connection
— TypeConnection of an InnerPort
to a Junction
EPHS.CompositeSystems.DAEConstraint
— TypeDAEConstraint(cvar::CVar, residual::SymExpr)
The residual
is forced to be zero by the corresponding constraint variable cvar
.
EPHS.CompositeSystems.DAEStorage
— TypeDAEStorage(xvar::XVar, quantity::Quantity, flow::SymExpr, effort::SymExpr)
Fields
xvar
: state variablequantity
: associated [EPHS.AbstractSystems.Quantity
]flow
: the time-derivative of the state variableeffort
: the differential of the exergy function w.r.t. the state variable
EPHS.CompositeSystems.DAESystem
— TypeDAESystem(storage::Vector{DAEStorage}, constraints::Vector{DAEConstraint})
A DAESystem
defines a system of differential(-algebraic) equations.
Fields
storage
: differential part (evolution of state variables)constraints
: algebraic part (residuals forced to be zero by constraint variables)
See DAEStorage
and DAEConstraint
.
EPHS.CompositeSystems.FlatSystem
— TypeFlatSystem(pattern::Pattern, connections::Dtry(Vector(Connection)))
A flat system is a composite system without any hierarchical nesting of (sub-)systems. This struct also controls if each junction has only one provider of effort and state.
EPHS.CompositeSystems.assemble
— Methodassemble(sys::CompositeSystem) -> DAESystem
Assemble the system of differential(-algebraic) equations corresponding to the given CompositeSystem
.
EPHS.CompositeSystems.update_parameters
— Methodupdate_parameters(dae::DAESystem, ps::Dtry{Float64}) -> DAESystem
Update the parameters of the given DAESystem
according to the directory of parameters ps
. Parameters that are not contained in ps
remain unchanged. Parameters in ps
that are not present in the system are ignored.
EPHS.MoreBase.flatten
— MethodMoreBase.flatten(sys::CompositeSystem{P}) ->
The function flatten
creates a flat system from a nested composite system using recursion.
- nested subsystems are converted into non-hierarchical systems
- connections, ports, and junctions are adjusted to assure consistency