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

Commit e99df9a

Browse files
authored
fix rhs description in docs (#14)
* fixing references * fixed docs error * fixed rhs description in docs
1 parent 651f899 commit e99df9a

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

src/NodeDynamicsBase.jl

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,20 @@ abstract type AbstractAlgebraicNodeDynamics{N <: AbstractNodeParameters} <: Abst
1616
# ODEs
1717
################################################################################
1818

19-
rhsdescription = @doc doc"""
19+
@doc doc"""
20+
```Julia
21+
OrdinaryNodeDynamics(;rhs, n_int)
22+
```
23+
24+
The type representing the dynamics of a node that is described via ODEs.
25+
26+
Each node ``a`` has the complex voltage ``u`` and ``n`` real internal variables ``y_1, \dots, y_n``, so it
27+
generally describes a system of ordinary differential equation as
28+
29+
```math
30+
\frac{du_a}{dt} = f_u(u_a, {i_c}_a, y_1, \dots, y_n) \\
31+
\frac{dy_{ak}}{dt} = f_k(u_a, {i_c}_a, y_1, \dots, y_n)\quad \forall k = 1, \dots, n.
32+
```
2033
``f`` is represented by `rhs` field of `OrdinaryNodeDynamics`.
2134
- the general signature of `rhs` is
2235
```Julia
@@ -35,24 +48,6 @@ rhs(dint_dt::AbstractVector,
3548
- Output
3649
- the (complex) return value describes ``\frac{du}{dt}``
3750
- `rhs` writes values in `dint_dt` describing the left-hand side ``\frac{dy_1}{dt}, \dots, \frac{dy_n}{dt}``
38-
"""
39-
40-
@doc doc"""
41-
```Julia
42-
OrdinaryNodeDynamics(;rhs, n_int)
43-
```
44-
45-
The type representing the dynamics of a node that is described via ODEs.
46-
47-
Each node ``a`` has the complex voltage ``u`` and ``n`` real internal variables ``y_1, \dots, y_n``, so it
48-
generally describes a system of ordinary differential equation as
49-
50-
```math
51-
\frac{du_a}{dt} = f_u(u_a, {i_c}_a, y_1, \dots, y_n) \\
52-
\frac{dy_{ak}}{dt} = f_k(u_a, {i_c}_a, y_1, \dots, y_n)\quad \forall k = 1, \dots, n.
53-
```
54-
55-
$rhsdescription
5651
5752
"""
5853
@with_kw struct OrdinaryNodeDynamics{N <: AbstractNodeParameters} <: AbstractOrdinaryNodeDynamics{N}
@@ -104,8 +99,24 @@ m^{int}_k\frac{dy_{ak}}{dt} = f_k(u_a, {i_c}_a, y_1, \dots, y_n)\quad \forall k
10499
105100
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
106101
this node dynamics type.
107-
108-
$rhsdescription
102+
``f`` is represented by `rhs` field of `OrdinaryNodeDynamics`.
103+
- the general signature of `rhs` is
104+
```Julia
105+
rhs(dint_dt::AbstractVector,
106+
u::Complex,
107+
i::Complex,
108+
int::AbstractVector,
109+
t,
110+
)::Complex
111+
```
112+
- Input
113+
- `u` is the complex voltage ``u``
114+
- `i` is the complex current ``i``
115+
- `int` is the array of internal variables ``y_1, \dots, y_n``
116+
- `t` is the time ``t``
117+
- Output
118+
- the (complex) return value describes ``\frac{du}{dt}``
119+
- `rhs` writes values in `dint_dt` describing the left-hand side ``\frac{dy_1}{dt}, \dots, \frac{dy_n}{dt}``
109120
110121
The binary masses are:
111122
- `m_u` is the boolean value for ``m_u``

0 commit comments

Comments
 (0)