17 A Framework for Dynamic Simulation of Interconnected …
601
Since the proposed solver has internal variables that depend on the time and
the current calculation step, there are issues associated with its application in a modelling system based on iterative calculations in conjunction with waveform relaxation
method. To overcome these problems, the solver was expanded with additional functionality that allows saving and loading its internal state on demand when switching
between different time windows of WRM.
From the point of view of unit developers, all the necessary functionality for
describing the state variables and model equations of specific units is implemented
as call-back functions.
4.2 Nonlinear Solver
The built-in solver for systems of nonlinear equations applies the KINSOL [10] solver
from the SUNDIALS package [57]. KINSOL allows for the solution of systems of
n nonlinear equations of the type
F( u) = 0, F: R
n
→ R
n
(11)
using Newton’s method or Picard iteration [10]. Additionally, systems of type
G( u) = =
u, G: R
n
→ R
n
(12)
can be solved by fixed-point iteration, which may be accelerated by Anderson
acceleration method [3].
The Newton-type method computes the iteration step δ n for iteration n using the
Jacobian
J (u n ) = F
(u n ).
(13)
The updates are calculated by
u n+1 = u n + λδ n , 0 < λ < 1
( 1 4 )
before checking for convergence. For the fixed-point solver, the updated values of
the variables
u n+1 = G( u n )
(15)
are tested for convergence after each iteration. During Anderson acceleration, intermediate solution steps are performed and combined with computed weights to find
the variable updates for the following iteration.
The solver class offers the user an interface for choosing the desired solving
method and for setting different solver parameters, such as the maximum number of
601
Since the proposed solver has internal variables that depend on the time and
the current calculation step, there are issues associated with its application in a modelling system based on iterative calculations in conjunction with waveform relaxation
method. To overcome these problems, the solver was expanded with additional functionality that allows saving and loading its internal state on demand when switching
between different time windows of WRM.
From the point of view of unit developers, all the necessary functionality for
describing the state variables and model equations of specific units is implemented
as call-back functions.
4.2 Nonlinear Solver
The built-in solver for systems of nonlinear equations applies the KINSOL [10] solver
from the SUNDIALS package [57]. KINSOL allows for the solution of systems of
n nonlinear equations of the type
F( u) = 0, F: R
n
→ R
n
(11)
using Newton’s method or Picard iteration [10]. Additionally, systems of type
G( u) = =
u, G: R
n
→ R
n
(12)
can be solved by fixed-point iteration, which may be accelerated by Anderson
acceleration method [3].
The Newton-type method computes the iteration step δ n for iteration n using the
Jacobian
J (u n ) = F
(u n ).
(13)
The updates are calculated by
u n+1 = u n + λδ n , 0 < λ < 1
( 1 4 )
before checking for convergence. For the fixed-point solver, the updated values of
the variables
u n+1 = G( u n )
(15)
are tested for convergence after each iteration. During Anderson acceleration, intermediate solution steps are performed and combined with computed weights to find
the variable updates for the following iteration.
The solver class offers the user an interface for choosing the desired solving
method and for setting different solver parameters, such as the maximum number of
