The situation is more complicated for rectangular matrices (1). In this case we need to find a rectangular matrix (10), which is called generalized inverse matrix or pseudoinverse matrix.
Definition of generalized inverse matrix. A generalized inverse matrix is called a matrix (10) with size n x m for a matrix (1) with size m x n satisfying the matrix equation:
Notes
It can be proved that for any matrix A there cannot exist two (or more) different generalized inverse matrices. See the proof in [1]
Definition (13) does not contradict the definition for a square inverse matrix (12)
If a square matrix is singular then a generalized inverse matrix can be calculated for it
I will take as an example a matrix for converting a three-phase voltage to a two-phase voltage for an electric motor:
3. Generalized Inverse Matrix Calculation
Now I will give without proof a description of the algorithm for finding the generalized inverse matrix. The proof of this algorithm see in [1]
Calculate the rank of the matrix A with size m x n:
We represent the matrix A as a product of two matrices B and C:
Matrix B is composed of r linearly independent columns of matrix A. The matrix C is calculated from (18)
Then we calculate the generalized inverse matrix with the formula:
Now let’s apply this algorithm to our example (14), (15), (16):
The rank of the matrix (15) is easy to find using an Octave Tool, see the MatrixFunctionsSupport.m
The matrix B is composed by taking the first two linearly independent columns from (15):
Multiplying the matrices in (26), we obtain the equations:
Solving these equations, we obtain the matrix C:
Now we calculate the generalized inverse matrix by formula (22) using the Octave Tool:
Then:
Finally we write down the solution for (16):
4. Download the MatrixGenInverseSupport.m
The Octave script supports the example calculation. You can download the file: