Skip to content

2.5. Numerical Integration

Julius Susanto edited this page Jun 28, 2017 · 10 revisions

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

Modified Euler Method

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:

  1. Compute predictor stage
  2. Solve and interface algebraic / network equations
  3. Compute corrector stage
  4. Solve and interface algebraic / network equations

4th-Order Runge-Kutta Method

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:

  1. Calculate k1
  2. Solve and interface algebraic / network equations
  3. Calculate k2
  4. Solve and interface algebraic / network equations
  5. Calculate k3
  6. Solve and interface algebraic / network equations
  7. Calculate k4 and state variables at next time step
  8. Solve and interface algebraic / network equations

Implementation

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.