Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

update the node dynamics docs with correct parameters #28

Open
timziebart opened this issue Jan 14, 2019 · 0 comments
Open

update the node dynamics docs with correct parameters #28

timziebart opened this issue Jan 14, 2019 · 0 comments

Comments

@timziebart
Copy link
Member

  • @doc doc"""
    ```Julia
    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
    ```math
    \frac{du_a}{dt} = f_u(u_a, {i_c}_a, y_1, \dots, y_n) \\
    \frac{dy_{ak}}{dt} = f_k(u_a, {i_c}_a, y_1, \dots, y_n)\quad \forall k = 1, \dots, n.
    ```
    ``f`` is represented by `rhs` field of `OrdinaryNodeDynamics`.
    - the general signature of `rhs` is
    ```Julia
    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 in `dint_dt` describing the left-hand side ``\frac{dy_1}{dt}, \dots, \frac{dy_n}{dt}``
    """
    @with_kw struct OrdinaryNodeDynamics{N <: AbstractNodeParameters} <: AbstractOrdinaryNodeDynamics{N}
    rhs::Function # how to define the function type, should be clear so the interface is forced, keyword FunctionWrapper
    symbols::ODENodeSymbols
    parameters::N
    n_int
    end
  • @doc doc"""
    ```Julia
    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
    ```math
    m_u\frac{du_a}{dt} = f_u(u_a, {i_c}_a, y_1, \dots, y_n) \\
    m^{int}_k\frac{dy_{ak}}{dt} = f_k(u_a, {i_c}_a, y_1, \dots, y_n)\quad \forall k = 1, \dots, n.
    ```
    As we assume that all masses are binary (either 1, or 0), that means, one can implement [semi-explicit differential algebraic equations](https://en.wikipedia.org/wiki/Differential-algebraic_system_of_equations) with
    this node dynamics type.
    ``f`` is represented by `rhs` field of `OrdinaryNodeDynamics`.
    - the general signature of `rhs` is
    ```Julia
    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 in `dint_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``
    """
    struct OrdinaryNodeDynamicsWithMass{N <: AbstractNodeParameters} <: AbstractAlgebraicNodeDynamics{N}
    ode_dynamics::OrdinaryNodeDynamics{N}
    m_u::Bool # Answers the question: Is the voltage treated as a dynamic variable with a differential
    m_int::AbstractVector{Bool} # for each internal variable: true if there is a differential for it, else false (if it is an algebraic constraint only)
    end
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant