Skip to content

Commit 660bc59

Browse files
committed
mention new method in feature page
1 parent 4a67925 commit 660bc59

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

docs/examples/init_tutorial.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#=
2-
# Tutorial on Stepwise Initialization of a Complex Model
2+
# [Tutorial on Stepwise Initialization of a Complex Model](@id init-tutorial)
33
44
This example demonstrates how to initialize a complex network model with both static
55
and dynamic components. We'll create a simple gas network model with three nodes

docs/src/initialization.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
# Initialization
22
Initialization of the system describes the process of finding valid initial conditions, mostly a fixpoint of the system.
3-
We distinguish between two types of initialization: full system initialziation and component initialization.
3+
We distinguish between two types of initialization: full system initialization and component initialization.
44

55
## Full-System Initialization
6-
Full system initialization describs the process of finding a fixpoint/steady state of th entire system.
6+
Full system initialization describes the process of finding a fixpoint/steady state of the entire system.
77

8-
To do so, you can use [`find_fixpoint`](@ref), which creates a `SteadyStateProblem` of the whole network and tries do solve it.
8+
To do so, you can use [`find_fixpoint`](@ref), which creates a `SteadyStateProblem` of the whole network and tries to solve it.
99

1010
## Component-wise Initialization
1111
In contrast to full-system initialization the goal of component-wise initialization is to find a valid initial condition for a single component first, given a network coupling.
1212

13-
This can be usefull in cases, where there are nontrivial internal dynamics and states within a single vertex or edge.
14-
The idea of component-wise initialisation is to find internal states which match a given "network coupling" (fixed inputs and outputs).
13+
This can be useful in cases, where there are nontrivial internal dynamics and states within a single vertex or edge.
14+
The idea of component-wise initialization is to find internal states which match a given "network coupling" (fixed inputs and outputs).
1515

16-
Lets consider the following example of a Swing-equation generator model.
16+
The following initialization workflow (as used in the [Tutorial on Initialization](@ref init-tutorial)) is quite common for complex dynamics:
17+
18+
1. Define simple, quasistatic models with the same input-output structure as the dynamic models.
19+
2. Find a solution of the static model using [`find_fixpoint`](@ref).
20+
3. Define elaborate, dynamical models. Define dynamical network on same graph topology.
21+
4. Use [`set_interface_defaults!`](@ref) to "copy" the inputs and outputs of all components from the static solution to the dynamical network.
22+
5. Use [`initialize_component!`](@ref) to fix "free" states and parameters within the dynamical models to find a steady state while satisfying the constraints on inputs/output.
23+
24+
Let's consider the following example of a Swing-equation generator model.
1725
```@example compinit
1826
using NetworkDynamics, ModelingToolkit
1927
using ModelingToolkit: t_nounits as t, D_nounits as Dt
@@ -47,7 +55,7 @@ sys = Swing(name=:swing)
4755
vf = VertexModel(sys, [:i_r, :i_i], [:u_r, :u_i])
4856
```
4957
You can see in the provided [metadata](@ref), that we've set `default` values for the node outputs `u_r`, `u_i`, the node inputs `i_r`, `i_i` and most parameters.
50-
For some states and parameters, we've onlye provided a `guess` rather than a default.
58+
For some states and parameters, we've only provided a `guess` rather than a default.
5159
Variables which only have `guess`es are considered "tunable" for the initialization algorithm.
5260

5361
In order to initialize the remaining variables we use [`initialize_component!`](@ref), which is a mutating function which tries to solve the nonlinear initialization problem and store the found values for the "free" variables as `init` metadata.
@@ -60,10 +68,10 @@ nothing #hide
6068
vf #hide
6169
```
6270

63-
Which lead to a successfull initialization of states `` and `` as well as parameter `:Pm`.
71+
Which led to a successful initialization of states `` and `` as well as parameter `:Pm`.
6472
To retrieve the residual you can use [`init_residual`](@ref).
6573

66-
As a quick test we can ensure that the angle indeed matches the voltag angel:
74+
As a quick test we can ensure that the angle indeed matches the voltage angle:
6775
```@example compinit
6876
get_init(vf, :θ) ≈ atan(get_default(vf, :u_i), get_default(vf, :u_r))
6977
```

0 commit comments

Comments
 (0)