Dynamics Types
Node Dynamics
In this section, the implemented general types of node dynamics (which are all subtypes of PowerDynBase.AbstractNodeDynamics
) with the corresponding helper functions and constants are introduced. The documentation is done for each type below. The main types are:
Abstract super type for all abstract node dynamics types.
OrdinaryNodeDynamics(;rhs, n_int)
The type representing the dynamics of a node that is described via ODEs.
Each node $a$ has the complex voltage $u$ and $n$ real internal variables $y_1, \dots, y_n$, so it generally describes a system of ordinary differential equation as
$f$ is represented by rhs
field of OrdinaryNodeDynamics
.
- the general signature of
rhs
is
rhs(dint_dt::AbstractVector,
u::Complex,
i::Complex,
int::AbstractVector,
t,
)::Complex
- Input
u
is the complex voltage $u$i
is the complex current $i$int
is the array of internal variables $y_1, \dots, y_n$t
is the time $t$
- Output
- the (complex) return value describes $\frac{du}{dt}$
rhs
writes values indint_dt
describing the left-hand side $\frac{dy_1}{dt}, \dots, \frac{dy_n}{dt}$
OrdinaryNodeDynamicsWithMass(;rhs, n_int, m_u, m_int)
The type representing the dynamics of a node that is described via ODEs.
Each node $a$ has the complex voltage $u$ and $n$ (= n_int
) real internal variables $y_1, \dots, y_n$, so it generally describes a system of ordinary differential equation with a voltage mass $m_u$ and internal masses $m^{int}_1, \dots, m^{int}_n$ as
As we assume that all masses are binary (either 1, or 0), that means, one can implement semi-explicit differential algebraic equations with this node dynamics type. $f$ is represented by rhs
field of OrdinaryNodeDynamics
.
- the general signature of
rhs
is
rhs(dint_dt::AbstractVector,
u::Complex,
i::Complex,
int::AbstractVector,
t,
)::Complex
- Input
u
is the complex voltage $u$i
is the complex current $i$int
is the array of internal variables $y_1, \dots, y_n$t
is the time $t$
- Output
- the (complex) return value describes $\frac{du}{dt}$
rhs
writes values indint_dt
describing the left-hand side $\frac{dy_1}{dt}, \dots, \frac{dy_n}{dt}$
The binary masses are:
m_u
is the boolean value for $m_u$m_int
is the array of boolean values for $m^{int}_1, \dots, m^{int}_n$
Helper Functions
to be done
PowerDynBase.internalsymbolsof
— Function.Get the symbols representing the internal variables of the node.
Grid Dynamics
Analogously, for each of the node dynamics types exists a corresponding grid dynamics type, that represents the dynamics of a whole power grid model. They are all subtypes of PowerDynBase.GridDynamics
These are:
PowerDynBase.OrdinaryGridDynamics
PowerDynBase.OrdinaryGridDynamicsWithMass
PowerDynBase.AlgebraicGridDynamics
PowerDynBase.GridDynamics
— Type.Abstract super type for all abstract grid dynamics types.
struct OrdinaryGridDynamics <: AbstractOrdinaryGridDynamics
rhs::NetworkRHS
end
The data structure that contains all the information necessary for a power grid model that can be described as an ordinary differential equation. In this case, only the PowerDynBase.NetworkRHS
is necessary.
struct OrdinaryGridDynamicsWithMass <: AbstractAlgebraicGridDynamics
rhs::NetworkRHS
masses::AbstractVector{Bool} # diagonal part of the mass matrix, off-diagonal is assumed to be 0 anyway
end
The data structure that contains all the information necessary for a power grid model that can be described as an ordinary differential equation with masses, i.e. a semi-explicit differential algebraic equation. rhs
is the PowerDynBase.NetworkRHS
. masses
is a 1-dimensional array representing the diagonal entries of the mass matrix. The off-diagonal entries are assumed to be 0. masses
can only contain boolean values representing: true
the equation is treated as a ordinary differential eqation and false
the equation is treated as an algebraic constraint on the state variables.
struct AlgebraicGridDynamics <: AbstractAlgebraicGridDynamics
rhs::NetworkRHS
differentials::AbstractVector{Bool} # boolean values whether there a variable is a differential
end
The data structure that contains all the information necessary for a power grid model that can be described as an differential algebraic equation. rhs
is the PowerDynBase.NetworkRHS
. differentials
is a 1-dimensional array of boolean values. A true
entry means the corresponding variable is dynamic and has a derivative variable. A false
entry means the corresponding variable is defined by an algebraic constraint only.
NetworkRHS
The logic of building a full power grid model (i.e. a subtype of PowerDynBase.GridDynamics
) is encoded in PowerDynBase.NetworkRHS
. Currently, the docs are a bit thin here.
PowerDynBase.NetworkRHS
— Type.struct NetworkRHS{T, M} <: AbstractNetworkFunction{T, M}
nodes::AbstractVector{T}
LY::M
numnodes
systemsize
intrange # unitrange telling me where I find the internal dynamic variables
nodalintranges # unit ranges to find the internal variables for each node in the full length of internal variables
end
Representing the full dynamics of the power grid.
Helper Functions
to be done