# Solving a system of linear equations with complex number?

In my circuit analysis class I consistently need to solve system of complex equations, and I can't use MATLAB or anything for it. Suppose I have the following system: (Note that $j = \sqrt{-1})$

$Va,Vs,Vo$ are unknowns in the form of $a + jb$

$$\frac{Va-Vs}{-j15} + \frac{Va}{33} + \frac{Va-Vo}{-j25}=0$$ $$\frac{Vo-Va}{-j25} + \frac{Vo-Vs}{10} = 0$$

Exactly how am I supposed to solve this equation if there are complex numbers in it (by hand)?

• Solving two-by-two systems "by hand" is easily done either by elimination or by Cramer's Rule. Of course you need to know how to do complex arithmetic (add/subtract, multiply, divide).but otherwise the computation is essentially the same as with real numbers. Note that your system is homogenous, with two equations in three unknowns. Therefore you can assign an arbitrary value to one of the unknown, and scale the resulting solution by an arbitrary complex factor. – hardmath Nov 9 '15 at 3:14
• If I use gauss elimination, do I need to make two matrixes? One for real numbers and one for complex numbers? I.e. C = A + jB – Jason Nov 9 '15 at 3:33
• No, just a matrix with complex entries. We are doing it by hand, after all. Start by collecting like-terms and rewriting your two equations. You might want to multiply both sides by a nonzero (possibly complex) factor to get rid of fractions. – hardmath Nov 9 '15 at 4:02
• Gaussian elimination works in any field, for example rational, real, and complex numbers form fields. Hence there is no problem in applying it to a linear system with complex coefficients. Regarding Matlab, it should have a function to solve a complex system, it's even likely that the "usual" functions work equally well on real and complex ones. See for example Matlab's help for mldivide and linsolve – Stop hurting Monica Nov 11 '15 at 13:10

The first task is to clear the fractions, making it easier to collect like terms. Note that dividing by $-j$ amounts to multiplying by $j$, and that integer denominators can be cleared by multiplying by their least common multiple. Thus:

$$\frac{V_a - V_s}{-15j} + \frac{V_a}{33} + \frac{V_a - V_o}{-25j} = 0$$

becomes, after multiplying by $33\cdot 25$:

$$(55j)(V_a - V_s) + 25V_a + (33j)(V_a - V_o) = 0$$

After collecting like terms:

$$(25+88j)V_a - 33j\; V_o - 55j\; V_s = 0 \tag{1}$$

Similar treatment of the second equation:

$$\frac{V_o - V_a}{-25j} + \frac{V_o - V_s}{10} = 0$$

results in:

$$(2j)(V_o - V_a) + 5(V_o - V_s) = 0$$

and then:

$$-2j\; V_a + (5+2j)V_o - 5V_s = 0 \tag{2}$$

A moment's study reveals that (1),(2) form an independent pair of homogeneous linear equations in the three unknowns $V_a,V_o,V_s$. Thus solutions will collectively be all scalar multiples of some particular solution, i.e. a one parameter family of solutions.

One approach would be to set (for example) $V_s = 1$ and solve for the other two values. This yields a linear system of two equations in two unknowns:

$$(25+88j)V_a - 33j\; V_o = 55j \tag{1'}$$

$$-2j\; V_a + (5+2j)V_o = 5 \tag{2'}$$

The augmented matrix for this system is:

$$\begin{bmatrix} 25+88j & -33j & \mid & 55j \\ -2j & 5+2j & \mid & 5 \end{bmatrix}$$

Putting the augmented matrix in reduced row echelon form is much the same use of elementary row operations, modified only insofar as complex arithmetic replaces real arithmetic.

Since it is desirable to do this "by hand", we will introduce a leading one in the first row by adding $44 - 6j$ times the second row to the first row (rather than by dividing the first row by $25 + 88j$):

$$\begin{bmatrix} 1 & 244-5j & \mid & 220-5j \\ -2j & 5+2j & \mid & 5 \end{bmatrix}$$

Now I would add $2j$ times the first row to the second, to eliminate the entry under the new leading one:

$$\begin{bmatrix} 1 & 244-5j & \mid & 220-5j \\ 0 & 15+490j & \mid & 15+440j \end{bmatrix}$$

Unfortunately we cannot put off doing a complex division much longer. To get a leading one in the second, I would divide by the coefficient $15+490j$:

$$\frac{15+440j}{15+490j} = \frac{3+88j}{3+98j} = 1 - \frac{10j}{3+98j}$$

The denominator of this last fraction can be rationalized:

$$\frac{10j}{3+98j} = \frac{10j(3-98j)}{3^2 + 98^2} = \frac{980+30j}{9613}$$

The (unreduced) row echelon form of the matrix is:

$$\begin{bmatrix} 1 & 244-5j & \mid & 220-5j \\ 0 & 1 & \mid & 1 - \frac{980+30j}{9613} \end{bmatrix}$$