-
Notifications
You must be signed in to change notification settings - Fork 31
2.5. Numerical Integration
In PYPOWER-Dynamics, the ordinary differential equations (ODE) are solved using explicit numerical integration methods. The following integrators are currently supported:
- Modified Euler
- 4th-order Runge-Kutta
The Modified Euler (or Heun's) method is a two-stage predictor-corrector method:
Predictor stage:
Corrector stage:
The algebraic variables and network equations are solved and interfaced after each stage of the integration procedure. The general procedure for each time step is as follows:
- Compute predictor stage
- Solve and interface algebraic / network equations
- Compute corrector stage
- Solve and interface algebraic / network equations
The 4th-order Runge-Kutta algorithm is one of the most popular numerical integration methods for power systems:
Like the Modified Euler method, the algebraic / network equations are solved and interfaced after each stage of the algorithm. The general procedure for each time step is as follows:
- Calculate k1
- Solve and interface algebraic / network equations
- Calculate k2
- Solve and interface algebraic / network equations
- Calculate k3
- Solve and interface algebraic / network equations
- Calculate k4 and state variables at next time step
- Solve and interface algebraic / network equations
In PYPOWER-Dynamics, the numerical integration routines are written into the solve_step()
functions of the machine models and controller classes. The run_sim.py
code handles calls to the individual solve_step()
functions and also coordinates the solution of the network equations and interfacing.