# Solving nodal analysis equations using matrices- gives a full rank matrix

I am trying to solve for node voltages in a circuit using nodal analysis. I am using the fact that the sum of the currents into each node must equal 0.

I have a system of equations which can be represented in matrix form as [G][V] = [0] where [G] is the conductance matrix, [V] is a column vector of node voltages and [0] is a column vector of 0s. I already know one of these node voltages since it is the value of the voltage source and I have been able to find a solution by rearranging the equations in terms of this known source voltage so the RHS is no longer 0.

However what I do not understand is why I am able to find a unique solution in the first place. The conductance matrix found is full-rank and therefore by the rank-nullity theorem, surely the only solution should be a vector of 0s.

Am I misunderstanding something?

• A better thing would be to show the matrix. Mar 16, 2021 at 16:11
• @VoltageSpike ok I have edited ! Mar 16, 2021 at 16:32
• Well, unless you include the input voltage of the source you are correct, meaning your null array is false. No input voltage and all nodes will be 0. KVL must always be satisfied! Mar 16, 2021 at 17:15
• @LukePitman You are missing an unknown in your matrix; the current in your voltage supply which is likely not zero.
– jonk
Mar 16, 2021 at 18:17

The schematic:

simulate this circuit – Schematic created using CircuitLab

The nodal equations:

$$\begin{array}{ccccl} V_0\cdot \left(G_0+G_{01}\right)&-V_1\cdot G_{01}&+V_2\cdot 0&=I\\ -V_0\cdot G_{01}&+V_1\cdot \left(G_{01}+G_1+G_{12}\right) &+ V_2\cdot G_{12}&=0\:\text{A}\\ V_0\cdot 0 &-V_1\cdot G_{12} &+V_2\cdot \left(G_{12}+G_2\right) &= 0\:\text{A} \end{array}$$

Their equivalent in matrix form:

$$\left[\begin{smallmatrix} G_0+G_{01}&-G_{01}&0\\ -G_{01} &G_{01}+G_1+G_{12}&-G_{12}\\ 0 &-G_{12} & G_{12}+G_2 \end{smallmatrix}\right]\left[\begin{smallmatrix}V_0\\V_1\\V_2\end{smallmatrix}\right]=\left[\begin{smallmatrix}I\\0\:\text{A}\\0\:\text{A}\end{smallmatrix}\right]$$

Since $$\V_0=V\$$ and is known (or else $$\I\$$ is known and $$\V\$$ isn't known), you have a consistent, unique solution.

You should be able to easily spot your error.

• Thanks. So once I include the unknown current 'I' from the source in my nodal equations, I can now solve the set of equations. Mar 17, 2021 at 13:37
• @LukePitman Yes, that's the idea. There is a non-zero (assumed) current that needs to be represented in the equations. Your nodal equation for $V_1$ missed including this fact. That's the only problem with your work. It was otherwise very nicely done!
– jonk
Mar 17, 2021 at 18:08

An equation $$\[G][V]=[0]\$$ is not a complete set of Kirchhoff law equations: it does not include KVL equations.

The Modified Network Analysis technique is an instrument for algorithmic composition of circuit equations. The MNA matrix $$\[A]\$$ of equation coefficients is a block matrix of the form $$A = \begin{bmatrix} G \,\, B \\ C \,\, D \end{bmatrix}$$ where the partition $$\[G]\$$ is a conductance matrix, the partitions $$\[B]\$$ and $$\[C]\$$ indicate nodes connected to voltage sources, and $$\[D]\$$ is generated when there are dependent sources in the circuit.

The column vector of unknowns is $$x = \begin{bmatrix} v \\ j \end{bmatrix}$$ where $$\[v]\$$ is a column vector of node potentials and $$\[j]\$$ is a column vector of currents through voltage sources.

The MNA equations have a right hand side $$z = \begin{bmatrix} I \\ V \end{bmatrix}$$ where $$\[I]\$$ is a column of current sources and $$\[V]\$$ is a column of voltage sources.

In this form ($$\[A][x] = [z]\$$) of nodal equations, the matrix $$\[A]\$$ is full rank and with non-zero RHS $$\[z]\$$ it does have a non-trivial solution for $$\[x]\$$ -- if your circuit has no dangling nodes, no infinitely loaded sources, etc.

Although to N equations of the ordinary nodal analysis (N is the node count) the MNA adds M equations for M voltage sources, the method significantly simplifies the composition of equations, which is beneficial, even absolutely necessary, for generating equations in software, as required for simulator program coding. The advantage also noticeable with manual composition of equation -- for example, for circuits with dependent sources (opamps). The investment in the form of educational effort into mastering the MNA would certainly pay. To start learning the method, see an excellent manual on MNA.

• Thank you. So basically I have omitted the fact that V1 is equal to the voltage of the source from my system of equations? When I insert this, the RHS will become non-zero and a non-trivial solution will exist? Mar 16, 2021 at 17:07
• 1) What is the variable V1: is it the voltage source's value (as per your comment) or is it an unknown potential at the $R01/R1/R12$ node (as per the question picture)? Also, declare the ground node. 2) The solution of MNA's linear equations exists iff your (ideal) circuit is realizable: no dangling nodes, no infinitely loaded sources, etc. 3) I recommend you to follow Modified Nodal Analysis guide's steps, practice examples. You can find MNA's recipe in a textbook of your choice or in my answer's ref. Mar 17, 2021 at 9:49