Skip to content

TOPS

Tiny Open Power System Simulator: dynamic power system simulation in plain Python, built to be read, run and modified.

import tops.dynamic as dps
import tops.ps_models.k2a as model_data

ps = dps.PowerSystemModel(model=model_data.load())
ps.init_dyn_sim()          # power flow + initialisation of all dynamic models

print(f"{ps.n_bus} buses, {len(ps.gen.GEN.par)} generators, {ps.n_states} states")
11 buses, 4 generators, 52 states

What it does

  • Power flow: Newton-Raphson.
  • Dynamic simulation: time-domain RMS (phasor) simulation with generators, exciters, governors, stabilisers, loads, converters and PLLs.
  • Events: short circuits and line switching, from a simple table.
  • Modal analysis: numerical linearisation, eigenvalues and mode shapes.
  • Extensible: write your own models from reusable control blocks.

The only dependencies are numpy, scipy, pandas and matplotlib.

Get started

  • Install

    pip install tops, or from source.

  • Quickstart

    A fault simulation in the two-area system, in four steps.

  • Model format

    How a power system is described as tables.

  • Modal analysis

    Find oscillation modes and their damping.

Citing

If you use TOPS in your research, please cite this paper. See About for the BibTeX entry.