Disturbance Devices#

Predefined disturbances at specified time can be created by adding the corresponding devices. Three types of predefined disturbances are supported:

  1. Three-phase-to-ground fault on buses. See Fault for details.

  2. Connectivity status toggling. Disconnecting, connecting, or reconnecting any device, including lines, generators and motors can be implemented by Toggle.

  3. Alteration of values. See Alter for details.

To use these devices, the time of disturbance needs to be known ahead of the simulation. The simulation program by default checks the network connectivity status after any disturbance.

Perturbation File#

One can implement any custom disturbance using a perturbation file as discussed in [Milano2010]. The perturbation file is a Python script with a function named pert. The example for the perturbation file can be found in andes/cases/ieee14/pert.py.

andes.cases.ieee14.pert.pert(t, system)[source]

Perturbation function called at each step.

The function needs to be named pert and takes two positional arguments: t for the simulation time, and system for the system object. Arbitrary logic and calculations can be applied in this function to system.

If the perturbation event involves switching, such as disconnecting a line, one will need to set the system.TDS.custom_event flag to True to trigger a system connectivity checking, and Jacobian rebuilding and refactorization. To implement, add the following line to the scope where the event is triggered:

system.TDS.custom_event = True

In other scopes of the code where events are not triggered, do not add the above line as it may cause significant slow-down.

The perturbation file can be supplied to the CLI using the --pert argument or supplied to andes.main.run() using the pert keyword.


Simulation time.


System object supplied by the simulator.


F. Milano, “Power System Modelling and Scripting,” in Power Modelling and Scripting, F. Milano, Ed. Berlin, Heidelberg: Springer, pp. 202-204, 2010.