Discover simulation methods for modeling electrical networks to analyze system behavior and optimize performance in various scenarios.
The simulation of an electrical network uses mathematical models of the components to calculate voltages, currents, and powers without building the circuit. It allows verifying a design, testing faults and switching operations, and comparing solutions at almost no cost before intervening on the system.
A network is described by Kirchhoff's laws and the characteristics of two-terminal components [1][3]. In nodal analysis, a reference node is chosen and, for each other node, the current equation is written, with currents expressed as conductance times voltage difference. The system obtained is
$$\mathbf{G}\,\mathbf{v} = \mathbf{i}$$
where $\mathbf{G}$ is the conductance matrix, $\mathbf{v}$ the vector of node voltages, and $\mathbf{i}$ the vector of currents injected into the nodes [2]. The matrix is symmetric and, for networks of resistors only, its diagonal elements are the sum of the conductances connected to the node, and the off-diagonal elements are the negative of the conductance between two nodes.
Circuit programs extend the method to nonlinear elements, solved by successive iterations, and to transient analysis: inductors and capacitors are replaced at each step with equivalent models, and the system is solved advancing in time with small steps.
For power networks in sinusoidal steady state, the power flow is solved: powers are assigned to the nodes and voltages and flows on the lines are calculated. The problem is nonlinear because power depends on the product of voltage and current, and it is solved by iterations, usually with the Newton-Raphson method [3]. A simplified version, the DC power flow, relates the power transmitted between two nodes to the difference of voltage angles:
$$P_{12} = \frac{\theta_1 - \theta_2}{X}$$
with $X$ the line reactance. The electrical network coordinates generation, transmission, and consumption, with dynamic controls that the models must represent [4].
A voltage source $12\ \mathrm{V}$ is connected to node 1 through $R_1 = 100\ \Omega$. Node 1 is connected to ground with $R_2 = 220\ \Omega$ and to node 2 with $R_3 = 330\ \Omega$; node 2 is connected to ground with $R_4 = 470\ \Omega$. The source with its resistance is equivalent to a current injected $12/100 = 0.12\ \mathrm{A}$ into node 1. The nodal equations, in siemens, are
$$\begin{pmatrix} \tfrac{1}{100}+\tfrac{1}{220}+\tfrac{1}{330} & -\tfrac{1}{330} \\ -\tfrac{1}{330} & \tfrac{1}{330}+\tfrac{1}{470} \end{pmatrix}\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0{,}12 \\ 0 \end{pmatrix}$$
The solution, calculated with Python, is $v_1 \approx 7.597\ \mathrm{V}$ and $v_2 \approx 4.463\ \mathrm{V}$. Verification: the ratio $v_2/v_1 = 0.5875$ matches that of the divider $470/(330 + 470) = 0.5875$, and the current supplied by the source, $(12 - 7.597)/100 = 44.0\ \mathrm{mA}$, equals the sum of the currents at node 1 toward ground and toward node 2, $7.597/220 + (7.597 - 4.463)/330 = 44.0\ \mathrm{mA}$.
For the time step, an RC circuit with $R = 1\ \mathrm{k\Omega}$, $C = 1\ \mu\mathrm{F}$, thus $\tau = 1\ \mathrm{ms}$, powered by a step of $1\ \mathrm{V}$, has capacitor voltage $1 - e^{-t/\tau}$, that is $0.6321\ \mathrm{V}$ after $1\ \mathrm{ms}$. With step $h = 0.1\ \mathrm{ms}$ the backward Euler method gives $0.6145\ \mathrm{V}$ (error $2.8\,\%$) and the forward one $0.6513\ \mathrm{V}$ ($3.0\,\%$). A smaller step reduces the error but lengthens the calculation.
In steady-state power flow, a line with $X = 0.1$ in per unit values carrying $P = 0.5$ in per unit values has an angle difference $\theta_1 - \theta_2 = 0.05\ \mathrm{rad} \approx 2.9^\circ$.
- A simulation is only as reliable as the input data and models: a wrong parameter gives precise but wrong results.
- Steady-state power flow neglects losses and reactive power, and only provides an order of magnitude of the flows.
- A too large integration step can make an explicit method unstable or damp fast phenomena with an implicit method.
- The result should be compared with a simplified manual calculation to detect model errors.
- Verification of electronic circuits before implementation.
- Studies of power flow, short circuit, and stability in networks.
- Training of operators and testing of protection systems.
[1] Wikipedia (it): Ingegneria elettrica
[2] Wikipedia (en): Nodal analysis
[3] Wikipedia (en): Power-flow study
[4] Wikipedia (fr): Réseau électrique
Generating summary…