Advanced Usage
Simulation and Estimation Parameters
Test cases are fully defined with in four files (two for simulation and two for estimation):
Simulation system parameters ./data/…/sim_param.txt
Simulated disturbances ./data/…/sim_dist.txt
Estimation system parameters ./data/…/est_param.txt
Estimation disturbance parameters ./data/…/est_dist.txt
The structure conveys completely separate sets of information necessary to simulate the system response to a disturbance (ground-truth values) and perform the estimation. The reason is that the part of available information (models and data) used for estimation can be wrong/incomplete/simplified or irrelevant.
The simulation is necessary for two reasons:
to generate measurements i.e., to generate the outputs of the system which will be used by the estimator to reconstruct all the states.
to evaluate the performance/accuracy of the estimation.
Simulation parameters
File: ./data/…/sim_param.txt
In this file the following information is specified:
Grid topology and parameters
Line, bus_i = “name”, bus_j = “name”, r = [p.u.], x = [p.u.], g = [p.u.], b = [p.u.], trafo = [p.u.]
Here all grid lines are specified. It is assumed that the values are already converted to the relative values, so the resistance, reactance, susceptance, and conductance are to be specified in p.u. values. Trafos, are therefore, not necessary and here in the trafo field only an off-nominal transformation ration of the trafo in the given branch should be specified. Ideally, this value is close to 1.0. See Transmission line for more details.
Dynamic models
SynchronousSubtransient, idx = “index”, bus = “name”, Sn = [MW], …
Here, the data of the employed dynamic models are defined. Some values re mandatory, such as the bus the model is connected to. Other values can be omitted and the code will run with default values specified in the corresponding python class. See Dynamic Models for details on available dynamic models.
Static models
StaticLoadPower, bus = “bus”
It is mandatory to define the nus at which the load is connected. P and Q can be specified but they will be overwritten once the initialization is executed and replaced by values that guarantee steady state at t = 0 [s]. For details about available static models, refer to Static Models.
Initialization data
The simulation for ground-truth values is initialized by running a power flow. The estimation is initialized from the ground-truth values by intentionally adding errors specified in the ./config.py file. The specified values for running the power flow are give in ./data/…/sim_param.txt with the following keyword:
Python name
BusInit
Each and every bus is separately specified. There can only be one slack node.
BusInit: A transmission bus to be included.
Parameters:
bus (str) – Name of the bus.
p (float) – Injected active power in [MW]. Positive corresponds to consumption.
q (float) – Injected reactive power in [MVar]. Positive corresponds to consumption.
v (float) – Bus voltage magnitude in [p.u.]
type (custom) – “PQ”, “PV”, or “slack”.
It needs to be specified as follows:
BusInit, bus = “name”, v = [p.u.], p = [MW], q = [MW], type =”type”
The bus name should be specified as a string. Supported types are = {“PQ”, “PV”, “slack”}. Active and reactive power are given in absolute values. The specified voltage is given in relative values.
Similarly, the parameters accessible to the estimator are defined in the ./data/…/est_param.txt file. These values may differ from the simulation parameters to account for possible errors in the parameter values. The dynamic models used by the estimator could be of a lower order, and the grid can be a subset of the simulation grid. Additionally, PMU measurements must be specified in this file for estimation.
Estimation Parameters
File: ./data/…/est_param.txt
Grid topology and parameters
Similar to Simulation parameters. The included branches can be a subset of the simulated branches and the parameters can contain errors.
Dynamic models:
Similar to Simulation parameters. The included models can be a subset of those included in the simulation. They can be simplified or have different parameters. It is important to use the same index as for the simulation such that the accuracy of the estimation can be plotted with respect to the correct ground-truth value.
Static models:
Similar to Simulation parameters.
Unknown buses
This part should list all buses which have unknown dynamic or static models connected to it. Unknown models are components whose models are unavailable to the estimator. It is important to specify all of them because the remaining buses, which have static or dynamic component connected to it and are not listed under unknown will be treated as zero-injection buses which will lead to wrong estimation in case there is some power being injected at the node. The specification requires only specifying the bus as string.
BusUnknown, bus =”name”
PMU measurements
Here, available PMU measurements are specified. Currently, the package supports two types of measurements:
Nodal voltage phasor measurements (BusVoltagePMU)
Branch current phasor measurement (BranchCurrentPMU)
BusVoltagePMU
BusVoltagePMU: Nodal voltage phasor measurements
Parameters:
bus (str) – Name of the bus.
acc (float) – Accuracy of the PMU measurement. This value is added as the standard deviation to both real and imaginary measurement.
distr (custom) – Noise distribution type. It supports the standard numpy random distributions.
BranchCurrentPMU
BranchCurrentPMU: Nodal voltage phasor measurements
Parameters:
bus_i (str) – Name of the bus sending bus (device located at this node).
bus_j (str) – Name of the bus receiving bus (uniquely identifies the branch).
acc (float) – Accuracy of the PMU measurement. This value is added as the standard deviation to both real and imaginary measurement.
distr (custom) – Noise distribution type. It supports the standard numpy random distributions.
Examples:
BusVoltagePMU, bus =”name”, acc = standard_deviation_of_measurement_error [p.u.], distr = noise distribution_type [string]
BranchCurrentPMU, bus_j = “name”, bus_i = “name”, acc = standard_deviation_of_measurement_error [p.u.], distr = noise distribution_type [string]
Future releases will include more measurement functions.
Simulation and Estimation Disturbances
Simulation disturbances are specified in the ./data/…/sim_dist.txt and ./data/…/est_dist.txt files. Currently, the package supports the following disturbances:
FAULT_LINE: A 3-phase short circuit in the middle of a transmission line. The specified admittance (real value) will be added between the ground and the middle of the line
by converting the “T” to “PI” model of the line.
Parameters:
time (float) – Time of disturbance in seconds.
type (str) – Must be
"FAULT_LINE"
.bus_i (str) – Name of the sending-end bus.
bus_j (str) – Name of the receiving-end bus.
y (float) – Fault admittance in per-unit.
FAULT_BUS: A 3-phase short circuit at a specified bus. The specified admittance (real value) will be added to the shunt element of the node.
Parameters:
time (float) – Time of disturbance in seconds.
type (str) – Must be
"FAULT_BUS"
.bus (str) – Name of the affected bus.
y (float) – Fault admittance in per-unit.
LOAD: Load power change at the specified bus. The specified active and reactive power in absolut values will be added to the consumption. It should be specified in the
same units as Sb (default MW and MVAr).
Parameters:
time (float) – Time of disturbance in seconds.
type (str) – Must be
"LOAD"
.bus (str) – Name of the affected bus.
p_delta (float) – Active power change in MW.
q_delta (float) – Reactive power change in MVAr.
CLEAR_FAULT_LINE: Removing the short circuit on the line.
Parameters:
time (float) – Time of disturbance in seconds.
type (str) – Must be
"CLEAR_FAULT_LINE"
.bus_i (str) – Name of the sending-end bus.
bus_j (str) – Name of the receiving-end bus.
CLEAR_FAULT_BUS: Removing the short circuit at the bus.
Parameters:
time (float) – Time of disturbance in seconds.
type (str) – Must be
"CLEAR_FAULT_BUS"
.bus (str) – Name of the bus.
- OPEN_LINE: Opening the line. If the line had a fault, the fault will be effectively neutralized.
Parameters:
time (float) – Time of disturbance in seconds.
type (str) – Must be
"OPEN_LINE"
.bus_i (str) – Name of the sending-end bus.
bus_j (str) – Name of the receiving-end bus.
Keep in mind that some disturbances may be unknown to the estimator (or, in reality, to the operator) or may only become known after a certain delay. Therefore, you can specify a disturbance in the estimation file with a delayed time or omit it entirely.
Refer to the working examples for more details.
Limitations
Only one injector is allowed per power system node. The reason is the initialization ambiguity. Now, the initialization will overwrite all production and conumption values
to start at a steady-state. If you need another component at the same node, create another node with minimal admittance connected to the desired node.