SOLVING COMPLEX SYSTEMS USING SPREADSHEETS: A MATRIX DECOMPOSITION APPROACH



Similar documents
December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

Using row reduction to calculate the inverse and the determinant of a square matrix

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

Typical Linear Equation Set and Corresponding Matrices

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

8 Square matrices continued: Determinants

Math 115A HW4 Solutions University of California, Los Angeles. 5 2i 6 + 4i. (5 2i)7i (6 + 4i)( 3 + i) = 35i + 14 ( 22 6i) = i.

1 Introduction to Matrices

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

Direct Methods for Solving Linear Systems. Matrix Factorization

6. Cholesky factorization

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

Operation Count; Numerical Linear Algebra

Solution of Linear Systems

Introduction to Matrices for Engineers

7.4. The Inverse of a Matrix. Introduction. Prerequisites. Learning Style. Learning Outcomes

Introduction to Matrix Algebra

SOLVING LINEAR SYSTEMS

A Direct Numerical Method for Observability Analysis

LINEAR ALGEBRA. September 23, 2010

Reciprocal Cost Allocations for Many Support Departments Using Spreadsheet Matrix Functions

Solving Systems of Linear Equations Using Matrices

Notes on Determinant

Factorization Theorems

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2

Solving Linear Systems, Continued and The Inverse of a Matrix

MAT188H1S Lec0101 Burbulla

Elementary Matrices and The LU Factorization

DETERMINANTS TERRY A. LORING

Question 2: How do you solve a matrix equation using the matrix inverse?

1 Determinants and the Solvability of Linear Systems

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial VI

3 Orthogonal Vectors and Matrices

Eigenvalues and Eigenvectors

Lecture 4: Partitioned Matrices and Determinants

Lecture 2 Matrix Operations

Similar matrices and Jordan form

Abstract: We describe the beautiful LU factorization of a square matrix (or how to write Gaussian elimination in terms of matrix multiplication).

Linear Algebra: Determinants, Inverses, Rank

1 Review of Least Squares Solutions to Overdetermined Systems

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

26. Determinants I. 1. Prehistory

9 MATRICES AND TRANSFORMATIONS

Linear Equations ! $ & " % & " 11,750 12,750 13,750% MATHEMATICS LEARNING SERVICE Centre for Learning and Professional Development

Matrix Differentiation

Lecture notes on linear algebra

University of Lille I PC first year list of exercises n 7. Review

The Characteristic Polynomial

Data Mining: Algorithms and Applications Matrix Math Review

Solving Systems of Linear Equations

POLYNOMIAL FUNCTIONS

K80TTQ1EP-??,VO.L,XU0H5BY,_71ZVPKOE678_X,N2Y-8HI4VS,,6Z28DDW5N7ADY013

Math 312 Homework 1 Solutions

5.04 Principles of Inorganic Chemistry II

Linear Algebra Notes for Marsden and Tromba Vector Calculus

The Image Deblurring Problem

Mathematics. ( : Focus on free Education) (Chapter 5) (Complex Numbers and Quadratic Equations) (Class XI)

Solving Mass Balances using Matrix Algebra

MATH APPLIED MATRIX THEORY

Chapter 19. General Matrices. An n m matrix is an array. a 11 a 12 a 1m a 21 a 22 a 2m A = a n1 a n2 a nm. The matrix A has n row vectors

8.2. Solution by Inverse Matrix Method. Introduction. Prerequisites. Learning Outcomes

Chapter 7. Matrices. Definition. An m n matrix is an array of numbers set out in m rows and n columns. Examples. (

Algebra Unpacked Content For the new Common Core standards that will be effective in all North Carolina schools in the school year.

Arithmetic and Algebra of Matrices

Orthogonal Diagonalization of Symmetric Matrices

3. Let A and B be two n n orthogonal matrices. Then prove that AB and BA are both orthogonal matrices. Prove a similar result for unitary matrices.

How To Understand And Solve Algebraic Equations

3.1. Solving linear equations. Introduction. Prerequisites. Learning Outcomes. Learning Style

The Singular Value Decomposition in Symmetric (Löwdin) Orthogonalization and Data Compression

x = + x 2 + x

MAT 242 Test 2 SOLUTIONS, FORM T

CONTROLLABILITY. Chapter Reachable Set and Controllability. Suppose we have a linear system described by the state equation

Brief Introduction to Vectors and Matrices

Math 1050 Khan Academy Extra Credit Algebra Assignment

7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix

Lecture 5: Singular Value Decomposition SVD (1)

CHAPTER 8 FACTOR EXTRACTION BY MATRIX FACTORING TECHNIQUES. From Exploratory Factor Analysis Ledyard R Tucker and Robert C.

Unit 18 Determinants

Using Ohm s Law to Build a Voltage Divider

Torgerson s Classical MDS derivation: 1: Determining Coordinates from Euclidean Distances

Similarity and Diagonalization. Similar Matrices

2.3. Finding polynomial functions. An Introduction:

Name: Section Registered In:

South Carolina College- and Career-Ready (SCCCR) Pre-Calculus

General Framework for an Iterative Solution of Ax b. Jacobi s Method

Solve addition and subtraction word problems, and add and subtract within 10, e.g., by using objects or drawings to represent the problem.

Systems of Linear Equations

Applied Linear Algebra I Review page 1

α = u v. In other words, Orthogonal Projection

LU Factoring of Non-Invertible Matrices

Here are some examples of combining elements and the operations used:

CS3220 Lecture Notes: QR factorization and orthogonal transformations

LAB 11: MATRICES, SYSTEMS OF EQUATIONS and POLYNOMIAL MODELING

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

Reduced echelon form: Add the following conditions to conditions 1, 2, and 3 above:

1 Solving LPs: The Simplex Algorithm of George Dantzig

A Concrete Introduction. to the Abstract Concepts. of Integers and Algebra using Algebra Tiles

1.2 Solving a System of Linear Equations

Transcription:

SOLVING COMPLEX SYSTEMS USING SPREADSHEETS: A MATRIX DECOMPOSITION APPROACH Kenneth E. Dudeck, Associate Professor of Electrical Engineering Pennsylvania State University, Hazleton Campus Abstract Many problems in engineering design and analysis, such as sinusoidal driven electrical circuits, produce a set of complex linear simultaneous equations. This set of equations form a complex system. Many algorithms have been developed to solve this system by [1] [4] finding the complex matrix inverse. This paper describes an approach using a spreadsheet, such as Excel. By using this approach, students can use the spreadsheet without the additional cost of purchasing additional software. Excel does not have complex math or complex matrix functions operations, but has real matrix functions. The algorithm is implemented by the decomposition of the complex matrix into real matrices and programming the spreadsheet using the built in real matrix functions afforded by the spreadsheet package. Approach A system of complex equations can be expressed as: Z v = k, (1) where Z is a complex square matrix of size n, v is the complex unknown vector and k is the complex system constant vector. The matrix system has the form below: z11 K z1n v1 k1 M O M M = M zn 1 z nn v n k L n The solution to this system, v, can be found if the inverse of Z, Z -1, is known. Z -1 Z v = Z -1 k

v = Z -1 k (2) Many commercial computer packages, such as Mathematica, can determine the inverse of a square complex matrix by using the determinates-of-cofactors procedure. Each of these determinates require complex arithmetic operations. The calculation of the inverse complex matrix can be determined solely based upon the inverses of decomposed real matrices thereby programmed using a standard spreadsheet package such as Excel. The original complex matrix, Z, can be decomposed into a real and imaginary matrix as shown below: z11 K z1n a11 K a1n b11 K b1 n M O M = M O M + i M O M zn 1 z nn an 1 a nn bn 1 b L L L nn and therefore, Z = A + i B, where A and B are real matrices representing the real and imaginary parts respectively of Z. If the inverse, Z -1 exists, then it can be expressed in terms of its real and imaginary parts as well. 1 z11 K z1n c11 K c1 n d11 K d1n M O M = M O M + i M O M z L z c L c d L d n1 nn n1 nn n1 nn and therefore, Z -1 = C + i D, (3) where C and D are the real matrices representing the real and imaginary parts respectively of Z -1. By multiplication of a complex matrix and its inverse the identity matrix, I, is obtained. Z -1 Z = I In terms of the decomposed matrices that product would be, (C + i D) (A + i B) = (CA - DB) + i (CB +DA) = I (4)

It should be noted here that these products represent a matrix multiplication of which is not commutative ( i.e. CA AC ). Equating the real and imaginary matrices yields, CA DB = I and CB + DA = 0 (5) Solving for D produces, D = -CBA -1 ( for A non-singular), (6.1) and substitution of D into equation (6.1) yields, C = [A + BA -1 B] -1 (6.2) These last two equations are the ones that are programmed into the spreadsheet. This formulation is only valid if the real matrix, A, is non-singular, meaning the inverse, A -1, exists. This can be determined by verifying the determinant of A is non zero, det(a) 0. If A is singular, but B is nonsingular, then an alternate formulation must be implemented as follows. Solving for D in the first equation produces, and substituting D into equation (7.1) yields, D = [CA I]B -1 (for B non-singular), (7.1) C = B -1 A [B + A B -1 A] -1 (7.2) This formulation is only valid if the real matrix, B, is non-singular, meaning the inverse, B -1 exists. This can be determined by verifying the determinant of B is non zero, det(b) 0. If both A and B are singular, then this approach will not yield an acceptable solution. For example, the matrix below decomposes into two singular real matrices but the complex determinate is i, meaning the complex matrix does exist. 1 i 1 1 1 1 0 + i 2+ i 2 2 2 1 0 For a system like the one above, the solution would need to found using a more powerful a software package such as Mathematica. Programming An Excel spreadsheet is programmed using three separate sheets. The top sheet, shown below, is the main sheet where the user enters the decomposed complex system. Red

fields show the real parts, where blue correspond to the imaginary parts of the system. The solution to the complex system is shown in yellow at the bottom of the sheet. The answers are expressed in both rectangular and polar forms. The decomposed complex matrix A +i B is mapped to the other two spreadsheets, which act like subroutines that perform actual calculations that are mapped back to the top spreadsheet. There other two sheets contain the calculations for finding the complex inverse for the Z matrix, namely Z -1 = C + i D. The second sheet, called Cal for A Non-Singular, calculates the inverse matrix using equations 6.1 and 6.2 which are valid for the real matrix A being non-singular. For example, part of equation 6.2 requires the term BA -1 to be calculated. The Excel formula below shows how the first element in the array is programmed. =INDEX(MMULT($J$1:$Q$8, MINVERSE($A$1:$H$8),ROW(A1),COLUMN(A1)) The remaining array elements can be programmed using copy and paste utilities. In this manner and entire approach outlined herein can be implemented. The third sheet called Cal for B Non-Singular calculates the inverse matrix using equations 7.1 and 7.2 which are valid for the imaginary matrix B being non-singular. The figure below shows the Cal for A Non-Singular spreadsheet.

Both these spreadsheets calculate Z -1 independently and also perform an identity check by multiplying Z -1 by Z to insure that the identity matrix, I, results. The main spreadsheet decides which of these two sub-spreadsheets it should use for the inverse. This is accomplished by taking the determinant of each real matrix, A and B. If the determinant of A is non-zero, then the resulting Z -1 is mapped from the Cal for A Non- Singular spreadsheet. If the determinant of A is zero then the resulting Z -1 is mapped from the Cal for B Non-Singular spreadsheet. On the main spreadsheet each cell where the inverse matrix is mapped from one of the two sub-speadsheets is accomplished by using an IF command for the decision making. Cell A14 for example has the following code: = IF($C$11<>0, Cal for A Non-Singular!A43, Cal for B Non-Singular!A43). The cell C11 is the cell where the determinate of A is calculated, and if that value is not zero, the cell A43 of the second sheet is mapped into its place. If the determinant is zero, then the cell is mapped from A43 of the third sheet. Each cell is programmed in this manner. Once the correct inverse matrix is mapped onto the main sheet, the complex solutions, v, can be programmed by simple matrix multiplication as shown in equation

(2). In terms of the decomposed real matrices (C and D) for Z -1 and (k r and k i ) for k, equation (2) becomes: v = (C k r D k i ) + i (D k r + C k i ) (8) The example shown here was for a set of four complex equations which yields a 4x4 complex matrix. It should be noted that the spreadsheet is laid out for a set of eight complex equations, or an 8x8 complex matrix. When fewer equations are needed, the unused equations should be set up so the remaining unknown variables are defined as zero. This is accomplished by setting 1 s along main diagonal of both the A and B matrices, and zeros off the main diagonals in the used rows and placing zeros in the unused rows of the k matrix. Conclusions The approach of decomposing the original complex matrix into two real matrices and solving for the decomposed inverse matrix has the advantage of allowing the use of the built in matrix functions of Excel. This approach is sound and produces the same results as an expensive mathematic package such as Mathematica, as long as one of the decomposed matrices is non-singular. In most real engineering applications, the resulting complex system will have at least one non-singular decomposed real matrix. References [1] [2] [3] [4] Ehrlich, L., Complex Matrix Inversion Versus Real Communications of the ACM, Volume 13, Issue 9 (September 1970) Pages: 561 562. Tornheim, L. Inversion of a Complex Matrix, Communications of the ACM, Volume 4, Issue 9 (September 1961) Page: 398. Businger, P, Golub, G., Singular Value Decomposition of a Complex Matrix Communications of the ACM, Volume 12, Issue 10 (October 1969) Pages: 564 565. Kagstrom, B. Ruhe, A, An Algorithm for Numerical Computation of the Jordon Normal Form of a Complex Matrix, ACM Transactions on Mathematical Software (TOMS), Volume 6, Issue 3 (September 1980) Pages: 437 443. Biographical Information KENNETH DUDECK is an Associate Professor of Electrical Engineering at the Pennsylvania State University located in Hazleton PA 18202. He has been teaching Electrical, Computer, and Electrical Technology Engineering Courses for the past 17 years. He is also a consultant for the Naval Air Warfare center in Patuxent River, MD.