đ Grid Modellingï
Three-phase AC systems dominate power transmission and distribution for their efficiency, capacity, and compatibility. While ideal systems are balanced and suitable for positive-sequence analysis, real networks often experience asymmetries from untransposed lines, uneven loads, single-phase connections, and converter-based resources. The classical symmetrical components method simplifies unbalanced fault analysis but struggles with strong sequence coupling, non-linearities, and complex topologies.
Direct phase-domain (abc) modelling overcomes these limitations by representing actual phase quantities, naturally handling asymmetry, non-linearities, and all fault types. It is particularly suited for transient simulations, EMTP tools, and control design across all voltage levels.
Power systems comprise generators, transformers, lines, loads, and compensation equipment, interconnected from generation through transmission and distribution to end users. Transmission operates at high voltages to reduce losses, with transformers stepping voltages up or down as required. Transmission circuits often include series and shunt compensation, while transformer winding configurations must be carefully modelled under unbalanced conditions. At the distribution level, load points can be highly unbalanced due to single-phase connections.
Linesï
Power lines are essential in delivering electricity from generation to loads. They consist of phase conductors
positioned above the ground, sometimes using it as a return path, which must be considered in parameter calculations.
Transmission lines may use bundled conductors and ground wires, while distribution lines can include a neutral return.
Both types can introduce geometric and electrical unbalances. Accurate modelling aims to calculate voltage drops and
losses, based on determining the per-unit-length parameters: resistance
, inductance
, conductance
,
and capacitance
.
Ï modelï
Transmission lines are mathematically modelled to describe their electrical behaviour. The inductive and resistive
effects of multiconductor lines are represented by a series impedance matrix, while capacitive effects are modelled as
a shunt admittance matrix. Together, these form the basis of the
-equivalent model commonly used in power system
studies.
It consists of:
Series impedance:

Shunt admittance:

In the
-model,
represents conductor resistance,
the self and mutual inductive reactances,
the shunt
conductance through insulation, and
the shunt susceptance from line capacitance. Shunt admittance is divided between
the ends, with series impedance in the middle. While the single-phase model is common, unbalanced systems require a 5-wire
representation, the three-phase conductors (
,
,
), the neutral (
), and the ground (
). The neutral returns
unbalanced current and stabilises voltage, while the ground provides a fault current path for safety. Each conductor
has its own impedance, and mutual coupling between all conductors requires a
impedance or admittance matrix.

In most transmission lines, the neutral conductor is absent as it is earthed at both ends. The ground return effect can
be incorporated into the phase impedance, allowing the line to be represented with a simplified
matrix.

Series Impedanceï
Carsonâs equations calculate the series self and mutual impedances of overhead transmission lines, accounting for the ground return path. They assume long, horizontally arranged conductors with average height for sag effects, homogeneous and lossless free space, uniform earth properties, and conductor spacing much greater than conductor radius to neglect proximity effects. The impedance matrix elements are derived from the tower geometry and conductor characteristics.
Then, the following equations are implemented to obtain the self and mutual values:


Where:
and
are the internal resistance and reactance of conductor
in
/km.
and
are the Carsonâs correction terms for earth return effects in
/km.
is the permeability of free space in H/km.
is the angular frequency in rad/s.
is the average height above ground of conductor
in m.
is the radius of conductor
in m.
is the distance between conductors
and
in m.
is the distance between conductor
and the image of conductor
in m.
The correction terms
and
are derived from an infinite integral representing the impedance contribution due
to the earth return path.
Shunt Admittanceï
Just as series impedance accounts for resistance and inductance, shunt admittance includes capacitance between conductors and ground, and between conductors themselves. Under the assumptions of lossless air, uniformly grounded earth, and conductor radii much smaller than inter-conductor spacing, these capacitances can be modelled mathematically to compute the corresponding shunt admittances.


Where
F/m is the free space permittivity.
Kronâs reductionï
Kronâs reduction, or node elimination, is a technique from network theory used to simplify a multi-node electrical network by eliminating certain nodes, often called internal or passive nodes, while preserving the electrical behaviour at the remaining nodes.
Assuming a set of nodes divided into two groups between ground conductors
(to eliminate) and phase conductors
(to keep), the impedance matrix is partitioned accordingly:

Where:
is the impedance between eliminated nodes.
is the mutual impedance between eliminated and preserved nodes.
is the mutual impedance between preserved and eliminated nodes.
is the impedance between preserved nodes.
Then, the network equations are:

Assuming that the eliminated nodes are held at zero voltage because they are grounded,
. From the
first row of the system:

Then, substituting
in the second row:

Finally, the Kron-reduced impedance matrix is defined as:

This new matrix allows to describe the electrical behaviour of the remaining phase nodes
, while implicitly
incorporating the effect of the eliminated ground nodes
, which were assumed to be held at 0 V.
Line definition exampleï
import VeraGridEngine.api as gce
import numpy as np
logger = gce.Logger()
grid = gce.MultiCircuit()
grid.fBase = 60
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus_632 = gce.Bus(name='632', Vnom=4.16, xpos=0, ypos=0)
bus_632.is_slack = True
grid.add_bus(obj=bus_632)
bus_671 = gce.Bus(name='671', Vnom=4.16, xpos=0, ypos=100 * 5)
grid.add_bus(obj=bus_671)
# ----------------------------------------------------------------------------------------------------------------------
# Impedance [Ohm/km] and Admittance [S/km]
# ----------------------------------------------------------------------------------------------------------------------
z_601 = np.array([
[0.3465 + 1j * 1.0179, 0.1560 + 1j * 0.5017, 0.1580 + 1j * 0.4236],
[0.1560 + 1j * 0.5017, 0.3375 + 1j * 1.0478, 0.1535 + 1j * 0.3849],
[0.1580 + 1j * 0.4236, 0.1535 + 1j * 0.3849, 0.3414 + 1j * 1.0348]
], dtype=complex) / 1.60934
y_601 = np.array([
[1j * 6.2998, 1j * -1.9958, 1j * -1.2595],
[1j * -1.9958, 1j * 5.9597, 1j * -0.7417],
[1j * -1.2595, 1j * -0.7417, 1j * 5.6386]
], dtype=complex) / 10 ** 6 / 1.60934
# ----------------------------------------------------------------------------------------------------------------------
# Line Configuration
# ----------------------------------------------------------------------------------------------------------------------
config_601 = gce.create_known_abc_overhead_template(name='Config. 601',
z_abc=z_601,
ysh_abc=y_601,
phases=np.array([1, 2, 3]),
Vnom=4.16,
frequency=60)
grid.add_overhead_line(config_601)
# ----------------------------------------------------------------------------------------------------------------------
# Lines Definition
# ----------------------------------------------------------------------------------------------------------------------
line_632_671 = gce.Line(bus_from=bus_632,
bus_to=bus_671,
length=2000 * 0.0003048)
line_632_671.apply_template(config_601, grid.Sbase, grid.fBase, logger)
grid.add_line(obj=line_632_671)
Definition of a line from the wire configurationï
Definition of the exercise
In this tutorial we are going to define a 3-phase line with 4 wires of two different types.
The cable types are the following:
name |
r |
x |
gmr |
max_current |
|---|---|---|---|---|
ACSR 6/1 |
1.050117 |
0.0 |
0.001274 |
180.0 |
Class A / AA |
0.379658 |
0.0 |
0.004267 |
263.0 |
These are taken from the data_sheets__ section
The layout is the following:
Wire |
x(m) |
y(m) |
Phase |
|---|---|---|---|
ACSR 6/1 |
0 |
7 |
1 (A) |
ACSR 6/1 |
0.4 |
7 |
2 (B) |
ACSR 6/1 |
0.8 |
7 |
3 © |
Class A / AA |
0.3 |
6.5 |
0 (N) |
Practice
We may start with a prepared example from the ones provided in the grids and profiles folder.
The example file is Some distribution grid.xlsx. First define the wires that you are going
to use in the tower. For that, we proceed to the tab Database -> Catalogue -> Wire.

Then, we proceed to the tab Database -> Catalogue -> Tower. Then we select
one of the existing towers or we create one with the (+) button.

By clicking on the edit button (pencil) we open a new window with the Tower builder editor.
Here we enter the tower definition, and once we are done, we click on the compute button (calculator).
Then the tower cross-section will
be displayed and the results will appear in the following tabs.

This tab shows the series impedance matrix (
) in several forms:
Per phase without reduction.
Per phase with the neutral embedded.
Sequence reduction.

This tab shows the series shunt admittance matrix (
) in several forms:
Per phase without reduction.
Per phase with the neutral embedded.
Sequence reduction.

When closed, the values are applied to the overhead line catalogue type that we were editing.
Transformersï
Power transformers link network sections operating at different voltages, such as generators and transmission systems.
For two-winding, three-phase transformers, the winding impedance
is derived from short-circuit tests, and
the iron-core shunt admittance
from open-circuit tests. Modelling begins with the schematic of the basic
two-winding transformer:
A transformerâs primary and secondary windings, with
and
turns respectively, have their voltages and
currents related through short-circuit and open-circuit admittance parameters. These relationships are represented in
the transformerâs electrical equivalent circuit:
In the per-unit system, the transformer voltage ratio
becomes
. Many transformers include tap
changers to regulate voltage by adjusting the ratio to
. In the
-model, virtual tap transformers
and
reconcile device and bus nominal voltages. From the single-phase transformer model, the corresponding
primitive admittance matrix is then derived to relate primary and secondary voltages and currents.

Using nodal analysis, single-phase transformer models can be extended to multi-winding, multi-phase configurations by
mapping winding voltages and currents (e.g., â
â) into the â
â phase frame. The primitive
parameters of three identical single-phase units are then combined to represent the full three-phase transformer.

Expressed in compact form, the resulting expression is:

Which can be operated in order to relate phase magnitudes:

It follows that the next step is to find the connectivity matrices
and
, which relate the voltages and
currents at each winding to the phase magnitudes, to obtain the transformer admittance matrix
.
This matrix links the primary and secondary phase voltages and currents:

The three-phase windings of power transformers may be connected in several ways. In high voltage transmission the most popular connections are star and delta, although the zig-zag connection is also used in distribution systems, depicted in figure bellow. Consequently, connectivity matrices must be computed for each configuration.
For instance, the following figure shows the three-phase delta-star (Dy) connection:
The transformation matrix
, which relates the voltages of each winding to the corresponding phase voltages,
is given explicitly in the following expression:

And in compact form:

Similarly, the inverse current connectivity matrix
is obtained:

And also in compact form:

The full transformer admittance matrix for the Dy connection is obtained by substituting the connectivity matrices
and
:

Finally, the transformer admittance matrix for the Dy connection is computed:

The admittance matrices for the other eight possible configurations have been obtained using exactly the same procedure.
Vector group and clock notationï
The vector group and clock notation define the connection type of the high-voltage (HV) and low-voltage (LV) windings of a three-phase transformer, as well as the phase displacement between their voltages. The HV side connection is indicated first using uppercase letters, followed by the LV side in lowercase. The phase displacement is then specified using clock notation:
The full circumference of a clock is
, which, divided by its
hours, assigns
to each hour.
If the high-voltage (HV) side is taken as the reference, the low-voltage (LV) side indicates the phase displacement
between the two voltages. For instance, a \textbf{Dy5} transformer connection means that the HV side is delta-connected,
the LV side is star-connected, and the phase displacement between them is
(
), as
illustrated in the figure above.
Transformer definition exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import WindingType
logger = gce.Logger()
grid = gce.MultiCircuit()
grid.fBase = 60
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus_1 = gce.Bus(name='633', Vnom=4.16, xpos=100 * 5, ypos=0)
grid.add_bus(obj=bus_1)
bus_2 = gce.Bus(name='634', Vnom=0.48, xpos=200 * 5, ypos=0)
grid.add_bus(obj=bus_2)
# ----------------------------------------------------------------------------------------------------------------------
# Transformer Definition
# ----------------------------------------------------------------------------------------------------------------------
trafo_1 = gce.Transformer2W(name='Transformer',
bus_from=bus_1,
bus_to=bus_2,
HV=4.16,
LV=0.48,
nominal_power=0.5,
rate=0.5,
r=1,
x=2)
trafo_1.conn_f = WindingType.GroundedStar
trafo_1.conn_t = WindingType.GroundedStar
grid.add_transformer2w(trafo_1)
Transformer definition from SC test valuesï
The transformers are modeled as Ï branches too. In order to get the series impedance and shunt admittance of the transformer to match the branch model, it is advised to transform the specification sheet values of the device into the desired values. The values to take from the specs sheet are:
: Nominal power in MVA.
: Voltage at the high-voltage side in kV.
: Voltage at the low-voltage side in kV.
: Nominal voltage of the high-voltage side bus kV.
: Nominal voltage of the low-voltage side bus kV.
: Short circuit voltage in %.
: Copper losses in kW.
: No load current in %.
: Contribution to the HV side. Value from 0 to 1.
Short circuit impedance (p.u. of the machine)

Short circuit resistance (p.u. of the machine)

Short circuit reactance (p.u. of the machine)
Can only be computed if 

Series impedance (p.u. of the machine)

The issue with this is that we now must convert
from machine base to the system base.
First we compute the High voltage side:



Now, we compute the Low voltage side:



Finally, the system series impedance in p.u. is:

Now, the leakage impedance (shunt of the model)



Finally, the shunt admittance is (p.u. of the system):

Inverse definition of SC values from Ï modelï
In VeraGrid I found the need to find the short circuit values
(
) from the branch values (R, X, G, B). Hence the following formulas:







Loads and Shuntsï
Given the diversity of loads in power networks, they are grouped into bulk consumption points and represented using the ZIP model, which combines impedance, current, and power components.
In steady-state studies, loads are represented as three-phase power sinks, connected in star or delta. Since the formulation uses phase-to-neutral voltages and line currents, all loads are modelled as star-connected, requiring delta loads to be converted to star equivalents for impedance, current, and power injections.
Constant impedance (Z) modelling of three-phase star-connected loads and shuntsï
Constant impedance loads and shunts are defined in terms of conductance G [MW] and susceptance B [MVAr].
If these elements have the three-phases active, and they are connected in star, the diagonal of the 3x3 admittance
matrix
is simply filled with the values defined for each phase:

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Three-phase star impedance load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(G1=0.160,
B1=0.110,
G2=0.120,
B2=0.090,
G3=0.120,
B3=0.090)
load.conn = ShuntConnectionType.GroundedStar
grid.add_load(bus=bus, api_obj=load)
Constant impedance (Z) modelling of three-phase delta-connected loads and shuntsï
However, if the load is defined in delta connection, the 3x3 matrix shown bellow will be used to mathematically model the load or the shunt element:

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Three-phase delta impedance load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(G1=0.160,
B1=0.110,
G2=0.120,
B2=0.090,
G3=0.120,
B3=0.090)
load.conn = ShuntConnectionType.Delta
grid.add_load(bus=bus, api_obj=load)
Constant impedance (Z) modelling of two-phase loads and shuntsï
Two-phase loads and shunts defined as admittances are converted to their corresponding equivalent power values in star
configuration. This conversion is carried out using the voltage, and the resulting power values must be updated at each
iteration of the algorithm. Therefore, in this case, the values are not stored in the admittance matrix
but
rather in the power vector
. The current flowing through this type of load is equal to the voltage difference
between the phases to which it is connected, multiplied by its admittance, as shown the equation bellow. By multiplying
the resulting current in each phase by its corresponding voltage, the power value can be obtained.

In the case where the load is connected between phases
and
, the conversion is as follows:
![\vec{S}_0 =
\begin{bmatrix}
\vec{U}_{a} \cdot \left[ (\vec{U}_{a} - \vec{U}_{c}) \cdot \dfrac{\vec{Y}_{ca}}{3} \right]^* \\
0 \\
\vec{U}_{c} \cdot \left[ (\vec{U}_{c} - \vec{U}_{a}) \cdot \dfrac{\vec{Y}_{ca}}{3} \right]^* \\
\end{bmatrix}](../_images/math/95b5540f167309253489dbbc0ec2313c4b09b37f.png)
Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Two-phase impedance load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(G1=0.0,
B1=0.0,
G2=0.0,
B2=0.0,
G3=0.230,
B3=0.132)
load.conn = ShuntConnectionType.Delta
grid.add_load(bus=bus, api_obj=load)
Constant impedance (Z) modelling of single-phase loads and shuntsï
Finally, single-phase loads and shunt elements are modelled as in the previous three-phase star case, but only saving
the admittance value for the active phase, for instance phase
:

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Single-phase impedance load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(G1=0.0,
B1=0.0,
G2=0.128,
B2=0.086,
G3=0.0,
B3=0.0)
load.conn = ShuntConnectionType.GroundedStar
grid.add_load(bus=bus, api_obj=load)
Constant current (I) modelling of three-phase star-connected loadsï
Traditionally, in positive sequence power flow analysis, constant current loads are directly stored in the
vector. However, since we are performing a three-phase power flow, the voltage angles of phases b and c are not zero,
so they must be taken into account. For both three-phase current star-connected loads, the defined phase currents are
stored in the vector
as follows:

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Three-phase star current load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(Ir1=0.160,
Ii1=0.110,
Ir2=0.120,
Ii2=0.090,
Ir3=0.120,
Ii3=0.090)
load.conn = ShuntConnectionType.GroundedStar
grid.add_load(bus=bus, api_obj=load)
Constant current (I) modelling of three-phase delta-connected loadsï
However, if the current load is defined in delta connection, the vector shown bellow will be used to mathematically model the element:

Note that for loads connected between phases, the voltage angle to be applied is not that of the phase to which the current load will be mapped, but rather the angle of the voltage difference between the two phases to which the current-defined load is connected. Then, the angles will be updated in each iteration, adding significant complexity compared to the traditional power flow.
Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Three-phase delta current load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(Ir1=0.160,
Ii1=0.110,
Ir2=0.120,
Ii2=0.090,
Ir3=0.120,
Ii3=0.090)
load.conn = ShuntConnectionType.Delta
grid.add_load(bus=bus, api_obj=load)
Constant current (I) modelling of two-phase loadsï
Two-phase current loads, connected for instance between phases
and
, are modelled in the same way as three-phase
delta-connected loads. The only difference is that, in this case, the current is defined solely as
, while the
other phase-to-phase currents remain zero:

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Two-phase current load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(Ir1=0.0,
Ii1=0.0,
Ir2=0.0,
Ii2=0.0,
Ir3=0.170,
Ii3=0.151)
load.conn = ShuntConnectionType.Delta
grid.add_load(bus=bus, api_obj=load)
Constant current (I) modelling of single-phase loadsï
Finally, single-phase current loads, connected for instance to phase
, are modelled in the same way as three-phase
star-connected loads. The difference lies in the fact that the absent phases are stored with a value of zero.

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Single-phase current load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(Ir1=0.0,
Ii1=0.0,
Ir2=0.170,
Ii2=0.080,
Ir3=0.0,
Ii3=0.0)
load.conn = ShuntConnectionType.GroundedStar
grid.add_load(bus=bus, api_obj=load)
Constant power (P) modelling of three-phase star-connected loadsï
Finally, we will address the modelling of constant power loads. In the case of a three-phase power load connected in
star, the values defined by the user are stored in the
vector for each phase:

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Three-phase star power load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(P1=0.485,
Q1=0.190,
P2=0.068,
Q2=0.060,
P3=0.290,
Q3=0.212)
load.conn = ShuntConnectionType.GroundedStar
grid.add_load(bus=bus, api_obj=load)
Constant power (P) modelling of three-phase delta-connected loadsï
In contrast, if the three-phase power load is connected in delta, the developed transformation to its star equivalent involves the phase-to-ground voltages. Then, the power transformation vector to star will be updated in each iteration, adding significant complexity compared to the traditional power flow.

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Three-phase delta power load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(P1=0.385,
Q1=0.220,
P2=0.385,
Q2=0.220,
P3=0.385,
Q3=0.220)
load.conn = ShuntConnectionType.Delta
grid.add_load(bus=bus, api_obj=load)
Constant power (P) modelling of two-phase loadsï
Two-phase power loads, connected for instance between phases
and
, are modelled in the same way as three-phase
delta-connected loads. The only difference is that, in this case, the power is defined solely as
, while the
other phase-to-phase powers remain zero:

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Two-phase power load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(P1=0.0,
Q1=0.0,
P2=0.0,
Q2=0.0,
P3=0.160,
Q3=0.110)
load.conn = ShuntConnectionType.Delta
grid.add_load(bus=bus, api_obj=load)
Constant power (P) modelling of single-phase loadsï
Finally, single-phase power loads, connected for instance to phase
, are modelled in the same way as three-phase
star-connected loads. The difference lies in the fact that the absent phases are stored with a value of zero:

Exampleï
import VeraGridEngine.api as gce
from VeraGridEngine import ShuntConnectionType
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=0.48)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Single-phase power load
# ----------------------------------------------------------------------------------------------------------------------
load = gce.Load(P1=0.0,
Q1=0.0,
P2=0.170,
Q2=0.125,
P3=0.0,
Q3=0.0)
load.conn = ShuntConnectionType.GroundedStar
grid.add_load(bus=bus, api_obj=load)
Generatorsï
For the power flow simulations, generators had been modelled as simple power injections into the system, which was
completely valid. However, this is not sufficient when performing the short-circuit analysis, as the impedance of the
generator must also be taken into account. VeraGrid has been programmed to accept a
impedance matrix, which
includes both the self and mutual impedances between the
phases.
It is also common to encounter generator impedances in the sequence domain. Therefore, Fortescueâs theorem is applied to obtain the equivalent values for the three phases:

Where the transformation eigenvector
is used.
The generator could be modelled during the short-circuit using the classic ThĂ©venin equivalent, that is, as an ideal voltage source in series with the generatorâs impedance, as shown in the electrical circuit of the following figure:
However, this would require to add an additional bus to the original system between the generatorâs impedance and the ideal voltage source. Therefore, the generator can be also modelled using its Norton equivalent, that is, an ideal current source in parallel with the generatorâs impedance, as shown in the schematic bellow:
The Norton current source will take the value of the internal voltage multiplied by its admittance:

Exampleï
import VeraGridEngine.api as gce
logger = gce.Logger()
grid = gce.MultiCircuit()
# ----------------------------------------------------------------------------------------------------------------------
# Buses
# ----------------------------------------------------------------------------------------------------------------------
bus = gce.Bus(name='Bus', Vnom=4.16)
grid.add_bus(obj=bus)
# ----------------------------------------------------------------------------------------------------------------------
# Generator
# ----------------------------------------------------------------------------------------------------------------------
gen = gce.Generator(vset=1.0, r1=0.004, x1=0.5, r2=0.02, x2=0.5, r0=0.01, x0=0.08)
grid.add_generator(bus=bus, api_obj=gen)
AC-DC modellingï
Here we are going to explore the modelling of AC-DC power systems.
HvdcLine: Modelling AC-DC links the easy wayï
The easy way of modelling HVDC links is by using the 2-generator model.
In VeraGrid this is represented by the HvdcLinedevice.

This is a well known model in the literature, however you cannot represent a proper DC grid with it, nor you can simulate contingencies on the DC elements or have more than one cable at a time.

Controls availableï
The HvdcLine device has only 2 controls: Active power control (Pset) and AC line emulation (free)
Control type |
Effect |
|---|---|
Pset |
Set active power |
free |
AC emulation: |
Letâs see a python example using 4 buses:
import VeraGridEngine as vg
# Grid instantiation
grid = vg.MultiCircuit()
# Define buses
bus1 = grid.add_bus(vg.Bus(name='B1', Vnom=135, is_slack=True))
bus2 = grid.add_bus(vg.Bus(name='B2', Vnom=135))
bus5 = grid.add_bus(vg.Bus(name='B5', Vnom=135))
bus6 = grid.add_bus(vg.Bus(name='B6', Vnom=135))
# Define AC lines
line12 = grid.add_line(vg.Line(name='L12', bus_from=bus1, bus_to=bus2, r=0.001, x=0.01))
line25 = grid.add_line(vg.Line(name='L25', bus_from=bus2, bus_to=bus5, r=0.05, x=0.05))
line56 = grid.add_line(vg.Line(name='L56', bus_from=bus5, bus_to=bus6, r=0.001, x=0.01))
line256 = grid.add_line(vg.Line(name='L562', bus_from=bus5, bus_to=bus6, r=0.001, x=0.01))
# Define Hvdc Line
line34 = grid.add_hvdc(vg.HvdcLine(name='L34', bus_from=bus2, bus_to=bus5, Pset=0.2))
# Define generators
grid.add_generator(bus=bus1, api_obj=vg.Generator(name='Gen1', P=1.0, vset=1.01))
grid.add_generator(bus=bus6, api_obj=vg.Generator(name='Gen2', P=1.0, vset=1.02))
# Define loads
grid.add_load(bus=bus2, api_obj=vg.Load(name='Load1', P=3.0, Q=0.3))
grid.add_load(bus=bus5, api_obj=vg.Load(name='Load2', P=2.0, Q=0.5))
# Run power flow
pf_options = vg.PowerFlowOptions(solver_type=vg.SolverType.PowellDogLeg,
retry_with_other_methods=False)
pf_driver = vg.PowerFlowDriver(grid=grid, options=pf_options)
pf_driver.run()
print('Bus values')
print(pf_driver.results.get_bus_df())
print('Branch values')
print(pf_driver.results.get_branch_df())
print("error:", pf_driver.results.error)
vg.save_file(grid, "6bus_a.veragrid")
Vsc: Modelling AC-DC links the better wayï
A better way of simulating AC-DC grids is what led us to research the literature for formulations that were complete, correct and explicit. Founding none, we started to create a formulation, by means of introducing how a converter device should behave.

It turns out that a converter cannot be a regular
-branch.
It has to be a decoupled branch represented by two injections.
More or less like the 2-generators model: 2 injections plus a coupling equation.

By introducing this type of branch, we get the freedom to represent the AC and DC grids in any level of detail.
Solvability rulesï
The power flow simulation is an optimization problem formed by equality constraints. Because of this:
For every AC island we must specify one voltage module
and one voltage angle
.
Usually, at the so called slack bus.For every DC island there must be a
set point.
This can be thought of as a DC slack.An AC branch has 4 unknowns (
)
and 4 equations (
).A DC branch has 2 unknowns (
) and 2 equations
(
).A converter branch has 3 unknowns (
)
and only 1 natural equation, the losses equation.
That is why every converter must control two magnitudes to
add the 2 extra equations needed.
Since we must ensure equal number of unknowns and equations globally, there is a control compatibility theory.
Controls availableï
Steaming from the solvability rules, we can introduce the converter controls. For every converter we need to choose 2 controls to ensure solvability.
Control type |
Effect |
|---|---|
|
Voltage module control at the DC side (from side) |
|
Voltage module control at the AC side (to side) |
|
Voltage angle control at the AC side (to side) |
|
Active power control at the AC side (to side) |
|
Reactive power control at the AC side (to side) |
|
Active power control at the DC side (from side) |
Putting it all togetherï
We wanted a no-compromise AC-DC power flow with good convergence properties.

This method was introduced in here and further developed in VeraGrid from 2024 to 2025.
6-bus exampleï
import VeraGridEngine as vg
# Grid instantiation
grid = vg.MultiCircuit()
# Define buses
bus1 = grid.add_bus(vg.Bus(name='B1', Vnom=135, is_slack=True))
bus2 = grid.add_bus(vg.Bus(name='B2', Vnom=135))
bus3 = grid.add_bus(vg.Bus(name='B3', Vnom=100, is_dc=True))
bus4 = grid.add_bus(vg.Bus(name='B4', Vnom=100, is_dc=True))
bus5 = grid.add_bus(vg.Bus(name='B5', Vnom=135))
bus6 = grid.add_bus(vg.Bus(name='B6', Vnom=135))
# Define AC lines
line12 = grid.add_line(vg.Line(name='L12', bus_from=bus1, bus_to=bus2, r=0.001, x=0.1))
line25 = grid.add_line(vg.Line(name='L25', bus_from=bus2, bus_to=bus5, r=1.05, x=0.5))
line56 = grid.add_line(vg.Line(name='L56', bus_from=bus5, bus_to=bus6, r=0.001, x=0.1))
line256 = grid.add_line(vg.Line(name='L562', bus_from=bus5, bus_to=bus6, r=0.001, x=0.1))
# Define DC lines
line34 = grid.add_dc_line(vg.DcLine(name='L34', bus_from=bus3, bus_to=bus4, r=2.05))
# Define VSCs
vsc1 = grid.add_vsc(vg.VSC(name='VSC1', bus_from=bus3, bus_to=bus2,
rate=100, alpha1=0.001, alpha2=0.015, alpha3=0.01,
control1=vg.ConverterControlType.Vm_ac,
control2=vg.ConverterControlType.Pdc,
control1_val=1.0333,
control2_val=0.2))
vsc2 = grid.add_vsc(vg.VSC(name='VSC2', bus_from=bus4, bus_to=bus5,
rate=100, alpha1=0.001, alpha2=0.015, alpha3=0.01,
control1=vg.ConverterControlType.Vm_dc,
control2=vg.ConverterControlType.Qac,
control1_val=1.05,
control2_val=-7.21))
# Define generators
grid.add_generator(bus=bus1, api_obj=vg.Generator(name='Gen1', P=1.0, vset=1.01))
grid.add_generator(bus=bus6, api_obj=vg.Generator(name='Gen2', P=1.0, vset=1.02))
# Define loads
grid.add_load(bus=bus2, api_obj=vg.Load(name='Load1', P=3.0, Q=0.3))
grid.add_load(bus=bus5, api_obj=vg.Load(name='Load2', P=2.0, Q=0.5))
# Run power flow
pf_options = vg.PowerFlowOptions(solver_type=vg.SolverType.PowellDogLeg,
retry_with_other_methods=False)
pf_driver = vg.PowerFlowDriver(grid=grid, options=pf_options)
pf_driver.run()
print('Bus values')
print(pf_driver.results.get_bus_df())
print(pf_driver.results.get_bus_df().to_markdown(tablefmt="grid"))
print('Branch values')
print(pf_driver.results.get_branch_df())
print(pf_driver.results.get_branch_df().to_markdown(tablefmt="grid"))
print("error:", pf_driver.results.error)
vg.save_file(grid, "6bus.veragrid")
Vm |
Va |
P |
Q |
|
|---|---|---|---|---|
B1 |
1.01 |
0 |
15.5919 |
-236.815 |
B2 |
1.0333 |
-0.215613 |
-3 |
-0.299984 |
B3 |
1.04608 |
0 |
-0.197999 |
-9.75607e-22 |
B4 |
1.05 |
0 |
0.198741 |
9.79262e-22 |
B5 |
1.02144 |
0.362496 |
-2 |
-0.499983 |
B6 |
1.02 |
0.373325 |
1 |
-29.3828 |
Pf |
Qf |
Pt |
Qt |
loading |
Ploss |
Qloss |
|
|---|---|---|---|---|---|---|---|
L12 |
15.5919 |
-236.815 |
-15.0397 |
242.337 |
1559.19 |
0.552148 |
5.52148 |
L25 |
1.66417 |
22.9626 |
-1.41595 |
-22.7143 |
166.417 |
0.248218 |
0.248218 |
L56 |
-0.497924 |
14.7122 |
0.500001 |
-14.6914 |
-49.7924 |
0.00207697 |
0.0207697 |
L562 |
-0.497924 |
14.7122 |
0.500001 |
-14.6914 |
-49.7924 |
0.00207697 |
0.0207697 |
L34 |
-0.199999 |
-9.75607e-22 |
0.200749 |
9.79262e-22 |
-19.9999 |
0.000749344 |
3.65533e-24 |
Distribution Grid Example in the Sequence Reference Frameï
This tutorial shows a step by step guide on how to build distribution grid system that contains: 13 Buses, 4 Transformers, 4 Loads. The tutorial shows how to create a grid using time profiles and device templates. The tutorial also contains:
Easy drag and drop creation of components.
Transformer type creation.
Overhead lines creation.
Templates for transformers and overhead lines.
Import of profiles into the loads.
Set s power flow snapshot from the profiles.
Execution of power flow.
Execution of power flow time series.
Automatic precision adjustment.
Results visualization.
Live results visualization (grid colouring).
A video tutorial can be found here
Note: this tutorial was made with VeraGrid v 4.0.0
However, we will do this using the VeraGrid GUI.
Step 0: System Overviewï
The system grid is supposed to look like the figure below.

The system features:
9 Buses.
5 Transformers.
4 Loads.
7 Lines.
Solution file of the grid system can be found in GitHub
Step 1: Create a Transformerï
Open VeraGrid:
âDrag and dropâ 2 âBusâ element to the diagram canvas:

Select (double âclickâ) Bus 0 and change the parameters (on the left side pane):
name |
HV Bus |
|---|---|
Vnom[kV] |
20 |
Select (double âclickâ) Bus 1 and change the parameters (on the left side pane):
name |
Bus 2 |
|---|---|
Vnom[kV] |
10 |
Hover over either bus element, âclick and dragâ (when there is a cross) to the other bus to create a branch.

Note: A transformer will be created between HV Bus and Bus 2 when nominal voltage values are different.
Note: The name of an element may not change until you âdouble clickâ the element on the diagram canvas after the change.
Step 2: Create Lines of Different Lengthsï
Create 3 more Buses (Bus 3, Bus 4 and Bus 5) and create a branch between them.

Select the branch between Bus 2 and Bus 3 and change its parameters to:
name |
Line 1 |
|---|---|
length[km] |
5 |
Select the branch between Bus 3 and Bus 4 and change its parameters to:
name |
Line 2 |
|---|---|
length[km] |
3 |
Select the branch between Bus 4 and Bus 5 and change its parameters to:
name |
Line 3 |
|---|---|
length[km] |
7 |
Note: Element placing can be changed by âclickingâ the square on the right hand side of a bus.
Step 3: Add More Lines and Busesï
Add Bus 6 to the right of Bus 2.
Add Bus 7 to the right of Bus 3.
Add Bus 8 and Bus 10 to the left of Bus 4.
Add Bus 9 and Bus 11 to the left of Bus 5.

Select the branch between Bus 2 and Bus 6 and change its parameters to:
name |
Line 4 |
|---|---|
length[km] |
2 |
Select the branch between Bus 3 and Bus 7 and change its parameters to:
name |
Line 5 |
|---|---|
length[km] |
1.6 |
Select the branch between Bus 4 and Bus 8 and change its parameters to:
name |
Line 7 |
|---|---|
length[km] |
1.5 |
Select the branch between Bus 5 and Bus 9 and change its parameters to:
name |
Line 8 |
|---|---|
length[km] |
2 |

Step 4: Create Loadsï
Select Bus 10 and change parameters to:
name |
House 3 |
|---|---|
Vnom[kV] |
0.4 |
Create a line between Bus 8 and House 3 (a transformer will be created). Rename it to âTR House 3â.
Select Bus 11 and change parameters to:
name |
House 4 |
|---|---|
Vnom[kV] |
0.4 |
Create a line between Bus 9 and House 4 (a transformer will be created). Rename it to âTR House 4â.
Right âclickâ on House 3 and select âAdd Loadâ.
Right âclickâ on House 4 and select âAdd Loadâ.

Step 5: Create House 1 and House 2ï
Create load House 1: Create a new bus and name it âHouse 1â to the right of Bus 6, and a transformer in the line between Bus 6 and House 1. The parameters are the following:
name |
House 1 |
|---|---|
Vnom[kV] |
0.4 |
Create load House 2: Create a new bus and name it âHouse 2â to the right of Bus 7, and a transformer in the line between Bus 7 and House 2. The parameters are the following:
name |
House 2 |
|---|---|
Vnom[kV] |
0.4 |
The full system topology looks like:

Note: do not forget to add the load after you rename the House buses.
Step 6: Defining the Main Transformerï
In order to define the type of transformer a catalogue is available within the VeraGrid repository.
This transformer is the transformer between HV Bus and Bus 2. The transformer is: 25 MV 20/10 kV.
Access the catalogue (Excel file). It can be found in the repository at
VeraGrid/Grids_and_profiles/grids/equipmentand select âequipment.odsâ.Select the âTransformersâ sheet.
Remove all filters on the âRate (MVA)â column by pressing on the downward arrow.

Select the â20 kVâ filter on the âHV (kV)â column using the downward arrow.
Select the â10 kVâ filter on the âLV (kV)â column using the downward arrow.
The parameters of the transformer are:
name |
25 MVA 20/10 kV |
|---|---|
Rate[MVA] |
25 |
Frequency[Hz] |
50 |
HV[kV] |
20 |
LV[kV] |
10 |
Copper Losses[kW] |
102.76 |
No Load Losses[kW] |
10.96 |
No Load Current[%] |
0.1 |
V Short Circuit[%] |
10.3 |
HV Vector Group |
YN |
LV Vector Group |
D |
Phase Shift |
5 |
Double click on the transformer between HV Bus and Bus 2 and enter the following parameters (based on the model selected):
Sn |
25 |
|---|---|
Pcu |
102.76 |
Pfe |
10.96 |
lo |
0.1 |
Vsc |
10.3 |
Once the parameters are placed, right click and select âAdd to catalogueâ. This way the branch p.u. values are calculated from the template values.
Note: In the new VeraGrid version, a transformer can be defined by just right clicking on the desired transformer and selecting the type from the drop down menu.
Note: All of the element types can be found under the âTypes catalogueâ tab after clicking on the desired element, then clock âLoad Valuesâ to change the parameters.
Step 7: Defining Load Transformersï
The transformers used for the 4 loads (houses) a 10 to 0.4 kV transformer will be used. The name is a â0.016 MVA 10/0.4 kV ET 16/23 SGBâ.
Using the same catalogue find the transformer and do this for the transformer between Bus 6 and House 1.
The parameters of the transformer are:
name |
0.016 MVA 10/0.4 kV ET 16/23 SGB |
|---|---|
Rate[MVA] |
0.016 |
Frequency[Hz] |
50 |
HV[kV] |
10 |
LV[kV] |
0.4 |
Copper Losses[kW] |
0.45 |
No Load Losses[kW] |
0.11 |
No Load Current[%] |
0.68751 |
V Short Circuit[%] |
3.75 |
HV Vector Group |
Y |
LV Vector Group |
ZN |
Phase Shift |
5 |
Fill these values out for the pop up menu:
Sn |
0.016 |
|---|---|
Pcu |
0.45 |
Pfe |
0.11 |
lo |
0.687510 |
Vsc |
3.75 |
Right click on the transformer and select âAdd to catalogueâ this will create a template for quick add.
Rename the transformer to âTR house 1â.
On the lower tabs select âTypes catalogueâ.

Select the transformer that has the characteristics of the 10 to 0.4 kV transformer and rename it to âHouse trafoâ. Now you have defined a transformer type that can be added to many transformers.
Note: In the new VeraGrid version, a transformer can be defined by just right clicking on the desired transformer and selecting the type from the drop down menu.
Step 8: Defining Other Transformersï
Now that âHouse trafoâ has been created, other transformers can be set to the same type.
In the âSchematicâ tab change the name of the other load transformers to their respective load (i.e. House 3 transformer rename to âTR house 3â).
Double click on the transformer
Click âLoad Valuesâ to set the parameters.
Repeat for all desired transformers: TR house 3, TR house 4, TR house 2.
Note: this can be done with all elements either to preloaded models or models you create.
Step 9: Defining Wires and Overhead Linesï
Just like in Step 7 access the âTypes catalougeâ and select âWiresâ.
All of the wire types will show up and select the 17th option âAWG SLDâ. The parameters are:
R [Oh/Km] |
1.485077 |
|---|---|
X [Ohm/Km] |
0 |
GMR [m] |
0.001603 |
Max Current [kA] |
0.11 |
Note: A new wire or custom wire can be added using the â+â button on the top right.
Now that you have located the wire you will use, in the same tab of âData structuresâ select âOverhead Linesâ.
Click on the â+â sign at the top right to create a new element. A new element â0:Towerâ should come up.
Select the element â0: Towerâ and click on the pencil on the top right corner to edit. A new window should pop up.
Rename the overhead line to: âDistribution Lineâ.
Select the wire âAWG SLDâ, highlight it and click on the â+â sign on the âWire compositionâ section below:

Add the âAWG SLDâ wire three times to enter the wire arrangement. The formulas come from ATP-EMTP.
Give each cable a different phase: 1, 2 and 3. Enter the following parameters for Phase 2 and Phase 3.
Wire |
X[m] |
Y [m] |
Phase |
|---|---|---|---|
AWG SLD |
0 |
7.0 |
1 |
AWG SLD |
0.4 |
7.3 |
2 |
AWG SLD |
0.8 |
7.0 |
3 |

Click on the âCompute matricesâ button the little calculator on the bottom right and you will be able to see:
-Tower Wire Position (right).
Z Series [Ohm/Km] for ABCN (under the âZ seriesâ tab at the top).
Z Series [Ohm/Km] for ABC (under the âZ seriesâ tab at the top).
Z Series [Ohm/Km] for the sequence components (under the âZ seriesâ tab at the top).
Y shunt [uS/Km] for ABCN (under the âY shuntâ tab at the top).
Y shunt [uS/Km] for ABC (under the âY shuntâ tab at the top).
Y shunt [uS/Km] for the sequence components (under the âY shuntâ tab at the top).
Close the window, and your âElements Dataâ tab should look lie:
To apply this model to the lines in the model: In the âSchematicâ tab change the name of the other load transformers to their respective load (i.e. House 3 transformer rename to âTR house 3â).
Double click on the desired line. Click âLoad Valuesâ to set the parameters.
Repeat for all desired lines. In this case Line 1 to Line 8. The âObjecs -> Lineâ Data tab should look like:

Note: this can be done with all elements either to preloaded models or models you create.
Step 10: Importing Load Profilesï
Head to the âTime Eventsâ tab on the bottom part of the GUI. Then click on the left and select âImport Profilesâ. This should bring up the âProfile Import Dialogueâ box.

Note: Make sure that the desired object is set to âLoadâ and power types are both set to âPâ.
Click on âImport fileâ box on the left. This will bring up a file explorer tab.
In the installation location head to ââŠ/VeraGrid/Grids_and_Profiles/profiles/âŠâ then select the Excel file called: âTotal_profiles_1W_1H.xlsxâ.

On the next dialogue box select âSheet 1â and âOKâ. Wait for all the profiles to load.
Any load profile can be selected. For example, click on âUSA_AL_Dothan.Muni.AP.7222268_TMY3_BASE(kW)â. Then select the âPlotâ tab to see the load profile in kW for January 2018.

Note: in the âAssignationâ tab, the units can be changed to: T, G, k , m Watts.
Set the units to âkâ.
On the right, you can see the different âObjectivesâ, fill the out by double-clicking on a profile and then double-clicking in the âactiveâ box of the desired âObjectiveâ. The profiles are assigned as follows:
Load@House 1: âUSA_AL_Muscle.Shoals.Rgni.AP.723235_TMY3_BASE(k@)â.
Load@House 2: âUSA_AZ_Douglas-Bisbee.Douglas.intl.AP.722735_TMY3_BASE(k@)â.
Load@House 3: âUSA_AL_Tuscaloosa.Muni.AP.722286_TMY3_BASE(k@)â.
Load@House 4: âUSA_AL_Birmingham.Muni.AP.722286_TMY3_BASE(k@)â.
The selection should look like this:

Click âAcceptâ to load the profiles.
On the âTime eventsâ tab, confirm that the time series has bene added:

To set the reactive power as a copy of the active power and scale it, click on the dropdown menu and select âQâ. Then click next to it on the âCopy the selected profile into the profiles selected next to this buttonâ button. When the pop up box comes on confirming the action select âYesâ.


On the bottom left side scale it by 0.8 and click on the multiply button. The profile should look like this:

The profiles can be visualized by 1) selecting the times, and load, and clicking on the âPlot the selected projectâs profileâ button.

Power flow snapshots can be seen also by going to the âTime eventsâ tabs, and then

Step 10: Set Power Flow From A Profileï
Once we have checked that the profiles are okay, we can set the power flow snapshot from the profiles and run a power flow.
Head to the âTime Seriesâ Tab and select â2018+01-03T12:00:00.00000000000000â.

Select the âAssign selected values to the selected time slot to the gridâ.
Select âYesâ.
Step 11: Running a Power Flowï
In order to run the power flow, we must select the slack bus. If you try run without one, you will get this error message:

Note: to run a Power Flow, select the âPower Flowâ button in the red square in the figure above.
Return to the âSchematicâ tab.
Select the âHV Busâ.
On the left pane, select âTrueâ in the âis_slackâ option.

Click on the âPower Flowâ button and the grid will be colored according to the voltage or loading.

Click on the âPower Flow Time Seriesâ button and the grid will be colored according to th

In addition by hovering above a transformer you can see the loading percentage and the power.

Step 12: Results & Featuresï
Here are some of the few results and features that are available with VeraGrid. All results can be found in the âResultsâ tab. Here you can see a list of all studies perfomed and their respective results:

In the results you can also choose from:
Study
Result Type
Devices
From here you can choose and customize the plot and results that are displayed to you.

Select the Study, Result Type and Devices, then the Data will pop up in table format, to graph it use the âGraphâ button on the top right. The graph will come up on a new figure:

In the âSchematicâ Tab, you can visualize the resultâs profiles, by selection the load, right click and selecting âPlot Profilesâ:

From the result plots you can do various things with the plot:

Power Flow on the 5-Node Example Gridï
This example creates the five-node grid from the fantastic book âPower System Load Flow Analysisâ and runs a power flow. After the power flow is executed, the results are printed on the console.
import VeraGridEngine.api as gce
# declare a circuit object
grid = gce.MultiCircuit()
# Add the buses and the generators and loads attached
bus1 = gce.Bus('Bus 1', Vnom=20)
# bus1.is_slack = True # we may mark the bus a slack
grid.add_bus(bus1)
# add a generator to the bus 1
gen1 = gce.Generator('Slack Generator', vset=1.0)
grid.add_generator(bus1, gen1)
# add bus 2 with a load attached
bus2 = gce.Bus('Bus 2', Vnom=20)
grid.add_bus(bus2)
grid.add_load(bus2, gce.Load('load 2', P=40, Q=20))
# add bus 3 with a load attached
bus3 = gce.Bus('Bus 3', Vnom=20)
grid.add_bus(bus3)
grid.add_load(bus3, gce.Load('load 3', P=25, Q=15))
# add bus 4 with a load attached
bus4 = gce.Bus('Bus 4', Vnom=20)
grid.add_bus(bus4)
grid.add_load(bus4, gce.Load('load 4', P=40, Q=20))
# add bus 5 with a load attached
bus5 = gce.Bus('Bus 5', Vnom=20)
grid.add_bus(bus5)
grid.add_load(bus5, gce.Load('load 5', P=50, Q=20))
# add Lines connecting the buses
grid.add_line(gce.Line(bus1, bus2, name='line 1-2', r=0.05, x=0.11, b=0.02))
grid.add_line(gce.Line(bus1, bus3, name='line 1-3', r=0.05, x=0.11, b=0.02))
grid.add_line(gce.Line(bus1, bus5, name='line 1-5', r=0.03, x=0.08, b=0.02))
grid.add_line(gce.Line(bus2, bus3, name='line 2-3', r=0.04, x=0.09, b=0.02))
grid.add_line(gce.Line(bus2, bus5, name='line 2-5', r=0.04, x=0.09, b=0.02))
grid.add_line(gce.Line(bus3, bus4, name='line 3-4', r=0.06, x=0.13, b=0.03))
grid.add_line(gce.Line(bus4, bus5, name='line 4-5', r=0.04, x=0.09, b=0.02))
results = gce.power_flow(grid)
print(grid.name)
print('Converged:', results.converged, 'error:', results.error)
print(results.get_bus_df())
print(results.get_branch_df())
Substations modellingï
To be done.






