# Kirchhoff's laws

German physicist, Gustav Robert Kirchhoff, had developed in 1845 the fundamental rules for circuit analysis, which we called today «Kirchhoff's laws».

## Kirchhoff's current law (KCL)

Kirchhoff's current law (KCL). The current flowing out of any node in a circuit must equal the current flowing in. ## Kirchhoff’s voltage law (KVL)

Kirchhoff’s voltage law (KVL). The algebraic sum of the branch voltages around any closed path in a network must be zero. We must choose the direction of circuit,but choose the direction of currents is arbitrarily.To simplify calculation,we usually defined clockwise as the direction of circuit.When we meet elements "$$+$$" first,and "$$-$$" second,the character of voltage is positive (voltage get lower);when we meet elements "$$-$$",and "$$+$$" second,the character of voltage is negative(voltage get higher). The KVL equation of the major loop is $$(R_1+R_2)I+E_2-E_1$$

## KVL & KCL method (fundamental method)

1. Find the numbers of junctions, branches with and without current sources.
2. Choose the direction of currents flow through each branch. The direction must be the same as the direction of voltage across the passive elements, or as the direction of the current source.
3. Apply Kirchhoff’s current and voltage laws to create a system of equation. Remember, that linear equations in a system are involving the same set of variables.
4. Solve the system of equation.

## Number of equations by Kirchhoff's laws

If n is the number of junctions then the number of independent KCL equations is $$n-1$$ If m is number of circuit branches, k is number of circuit branches consisting the current sources. The number of KVL equation is $$m-k-(n-1)$$ The number of KCL and KVL equations is the number of unknown currents in the circuits.

# Branch-current(voltage) method

1. Choose the direction of currents arbitrarily. Choose the directions of mesh currents arbitrarily (clockwise direction is recommended).
2. Use KCL to get $$n-1$$ independent KCL equations.
3. Combine KVL and elements VAR to get $$m-k-(n-1)$$ KVL equations.
4. Solve the equations to get the amount of each current.

# Nodal-voltage method

There are $$m-k$$ variables in the equations of branch method,it is still a trouble to solve the circuit. A set of node-voltage variables that implicitly satisfy the Kirchhoff's law is selected in order to formulate circuit equations. A reference (ground) node is chosen arbitrarily based on convenience, and from each of the remaining nodes to the reference node, the voltage drops are defined as node-voltage variables. To simplify calculation we transform the resistance into conductances. $$g_1=\frac{1}{R_1}\qquad g_2=\frac{1}{R_2}\qquad g_3=\frac{1}{R_3}$$ $$\varphi _0=0$$-The potential of the reference node. Using the KCL: $$I_1+I_2-I_3=0$$ $$I_1=\left(\varphi_1-\varphi_3\right)g_1\qquad I_2=\left(\varphi_2-\varphi_3\right)g_2\qquad I_3=\left(\varphi_3-\varphi_0\right)g_3\\$$ $$\varphi_1-\varphi_0=E_1\qquad \varphi_2-\varphi_0=E_2$$ $$\varphi_3\left(g_1+g_2+g_3 \right )=E_1g_1+E_2g_2$$ $$\varphi_3 =\frac{E_1g_1+E_2g_2}{g_1+g_2+g_3}$$

1. Use the Kirchhoff's current law to get the system of expressions.
2. Derive the matrix from the system of equations.
3. Calculate the potentials of nodes and derive the values of all currents.

# The Case of analysis of complex circuit by nodal-voltage method  1. Choose the reference node and the direction of currents arbitrarily. Enumerate the potentials of each node. Transform the resistances into conductances.
2. Use the Kirchhoff's current law to get the system of expressions: \left\{ \begin{aligned} &I_2+I_3=I_1\\ &I_3+I_4+I_5=0 \end{aligned} \right.\rightarrow \left\{ \begin{aligned} &\varphi_1\left(g_1+g_2+g_3 \right )-\varphi_2 g_3=E_1g_1\\ &-\varphi_1g_3+\varphi_2\left(g_3+g_4+g_5 \right )=0 \end{aligned} \right.
3. Derive the matrix from the system of equations: \left\{ \begin{aligned} &\varphi_1\left(g_1+g_2+g_3 \right )-\varphi_2g_3=E_1g_1 \\ & \varphi_1g_3+\varphi_2\left(g_3+g_4+g_5 \right )=0 \end{aligned} \right. \rightarrow \begin{pmatrix} & g_1+g_2+g_3 & -g_3\\ & -g_3 & g_3+g_4+g_5 \end{pmatrix} The sums of all conductances connected to each node: $$g_{11}=g_1+g_2+g_3,g_{22}=g_3+g_4+g_5,g_{33}=g_5+g_6$$ The sums of all conductances connected between two nodes: $$g_{12}=g_{21}=-g_3,g_{13}=g_{31}=0,g_{23}=g_{32}=-g_5$$

# Mesh-current(voltage) method

Thanks to Maxwell,there are two classic techniques,which are based on the usage of intermediate concepts of mesh-currents and nodal-voltages.

1. Choose the direction of currents arbitrarily. Choose the directions of mesh currents arbitrarily (clockwise direction is recommended).
2. Use the Kirchhoff's voltage law to get the system of expressions.
3. Derive the matrix from the system of equations and calculate the mesh currents.
4. Use the values of mesh currents to calculate the currents in the circuit branches.

# The Case of analysis of complex circuit by mech-current method

1. Choose the direction of currents arbitrary.But once the direction is selected it can't be changed. 2. Derive the system of equation by Kirchhoff's voltage law: \left\{ \begin{aligned} &I_{11}\left(R_1+R_2 \right )-I_{22}R_2=E_1 \\ &-I_{11}R_2+I_{22}(R_2+R_3+R_4)-I_{33}R_4=0 \\ &-I_{22}R_4+I_{33}(R_4+R_5+R_6)=0 \end{aligned} \right.
3. Derive the matrix from the system of equations: \left\{ \begin{aligned} &I_{11}R_1+I_{22}R_{12}=E_1 \\ &I_{11}R_{21}+I_{22}R_{22}+I_{33}R_{23}=0 \\ &I_{22}R_{32}+I_{33}R_{33}=0 \end{aligned} \right. \rightarrow \begin{pmatrix} & R_{11} & R_{12} & R_{13} \\ & R_{21} & R_{22} & R_{23} \\ & R_{31} & R_{32} & R_{33} \\ \end{pmatrix} The sums of all resistances contained in each mesh: $$R_{11}=R_1+R_2,R_{22}=R_2+R_3+R_4,R_{33}=R_4+R_5+R_6$$ The sums of all resistances common to two meshes : $$R_{12}=R_{21}=-R_2,R_{13}=R_{31}=0,R_{23}=R_{32}=-R_4$$

# Power сonservation

The total input power is equal to the sum of the two components: stored energy and absorbed energy. In DC circuit there is no stored energy. $$P_{\text{input}}=P_{\text{absorb}}$$ Sum of powers generated by each source: $$P_{\text{input}}=P_{E_1}+P_{E_2}=I_1E_1+I_2E_2$$ Sum of powers consumed by each resistance: $$P_{\text{absorb}}=P_{R_1}+P_{R_2}+P_{R_3}=I^2_1R_1+I^2_2R_2+I^2_3R_3$$

# Superposition theorem

The response (voltage or current) in any branch of a linear circuit having more than one source equals the algebraic sum of the responses caused by each source acting alone, where all the other sources are replaced by their internal resistances.

To ascertain the contribution of each individual source, all of the other sources first must be "turned off" (set to zero) by: Replacing all other voltage sources with a short circuit; Replacing all other current sources with an open circuit. $$I_3={I_3}'+{I_3}''$$ $${I_1}'=\frac{E_1}{R_1+\frac{R_2R_3}{R_2+R_3}}\qquad {I_3}'=\frac{{U_3}'}{R_3}=\frac{{I_1}'\left(\frac{R_2R_3}{R_2+R_3} \right )}{R_3}=\frac{E_1R_2}{R_1R_2+R_1R_3+R_2R_3}$$ $${I_1}''=\frac{E_2}{R_2+\frac{R_1R_3}{R_1+R_3}}\qquad {I_3}''=\frac{{U_3}''}{R_3}=\frac{{I_1}''\left(\frac{R_1R_3}{R_1+R_3} \right )}{R_3}=\frac{E_2R_1}{R_1R_2+R_1R_3+R_2R_3}$$ The total current $$I_3$$ can be expressed as sum of derived parts in accordance with their polarities: $$I_3={I_3}'+{I_3}''=\frac{E_1R_2+E_2R_1}{R_1R_2+R_1R_3+R_2R_3}$$

# Thevenin's theorem

Any linear electrical network containing only one-ports can be replaced at terminals a-b by an equivalent combination of a voltage source $$E_{\text{th}}$$ in a series connection with a resistance $$R_{\text{th}}$$. $$I_3=\frac{E_\text{th}}{R_\text{th}+R_3}$$

# Circuit analysis by Thevenin's theorem

1. Find the Thevenin Resistance $$R_{\text{th}}$$ by removing all voltage sources and resistor $$R_3$$: $$R_\text{th}=\frac{R_1R_2}{R_1+R_2}$$

2. Find the Thevenin Voltage $$U_\text{th}$$ by plugging in the voltages: $$I_\text{in}=\frac{E_1-E_2}{R_1+R_2}$$ $$U_\text{th}=E_2+I_\text{in}R_2=\frac{E_2R_1+E_1R_2}{R_1+R_2}$$

3. Use the Thevenin Resistance and Voltage $$U_\text{th}=E_\text{th}$$ to find the current flowing through the load: $$I_3=\frac{E_\text{th}}{R_\text{th}+R_3}=\frac{E_1R_2+E_2R_1}{R_1R_2+R_1R_3+R_2R_3}$$