Friday, September 12, 2014

Inverse of a Matrix

For 2 x 2 Matrices

A =  [ 2  -3 ]  where A = [ a b ]
        [ 2   1 ]                    [ c d ]
Find the inverse of matrix A.

Solution:

   A-1 =  1/(ad-bc)  [ d  -b ]
                              [ -c  a  ]


          = 1/(2 + 6) [ 1 3 ]
                            [-2 2 ]

          = 1/8 [ 1 3 ]
                   [-2 2 ]

      A-1 =  [  1/8   3/8 ]
                 [-1/4   1/4 ]


           

Friday, September 5, 2014

The Transpose of a Matrix

The transpose of a matrix is formed by writing its columns as rows.

For Example:
           
            [   2   3   6   ]                                                                       [   2   4   5   ]
If A =    [   4   2   1   ] , then the transposed matrix will be AT =        [   3   2   9   ]
            [   5   9   8   ]                                                                       [   6   1   8   ]

Properties of Matrices
If A and B are matrices ( with sizes such that the given matrix operations are defined ) and c is a scalar, then the following properties are true.

1. (AT)T = A                    Transpose of a transpose
2. (A+B)T = AT + BT           Transpose of a Sum
3. (cA)T = c(AT)             Transpose of a Scalar Multiple
4. (AB)T = BTAT             Transpose of a Product

Finding the Transpose of a Product

Show   (AB)T.


        [   2   7    ]
A =  [   5   8    ]         B = [  2   2  4 ]
        [   1   3    ]                [  6   1   7]

Solution:
            [  2  7  ]         
AB =   [  5   8  ]   x  [  2  2  4  ]
            [  1   3  ]      [  6  1  7  ]

         [ (2)(2) + (7)(6)   (2)(2) + (7)(1)     (2)(4) + (7)(7)]
AB = [ (5)(2) + (8)(6)   (5)(2) + (8)(1)     (5)(4) + (8)(7)] 
         [  (1)(2) + (3)(6)   (1)(2) + (3)(1)     (1)(4) + (3)(7)] 

           [ 4 + 42     4 + 7     8 + 49   ]
AB =  [ 10 + 48  10 + 8    20 + 56 ]
           [ 2 + 18     2 +  3     4 + 21  ]

          [ 46    11   57 ] 
AB = [ 58     18   76 ] 
          [ 20      5    25 ]

           [ 46   58    20 ]  
ABT = [ 11    18    5  ]
           [ 57   76    25 ]





Friday, August 15, 2014

Subtraction of Matrices

The subtraction of matrices is basically like matrix addition. You just subtract them instead of adding. For example:

        [3  7  5]               [5  2  9]
A =   [2  0  6]        B = [4  7  1]
        [8  9  1]               [3  2  6]

Where we have to solve A - B.

The solution is simply

      [ 3 - 5   7 - 2   5 - 9 ]  
      [ 2 - 4   0 - 7   6 - 1 ]
      [ 8 - 3   9 - 2   1 - 6 ]

         [ -2   5   -4 ]
     =  [ -2  -7    5 ]
         [  5   7   -5 ]

Like addition, we also cannot subtract matrices that have different sizes such as
       [ 7 ]
A = [ 2 ]    and     B = [  3  4  6  ]
       [ 4 ]

Friday, August 8, 2014

Multiplication of Matrices

If A = [aij] is an m x n matrix and B = [bij] is an n x p matrix, then the product AB is an m x p matrix.


Sample Problem #1

       [   1   5   2   ]          [ 3 ]
A=   [   2   9   5   ]    B= [ 5 ]
       [   5   2   6   ]          [ 1 ]
Matrix A is measured to be 3 x 3, while Matrix B is 3 x 1.
This means that we can multiply the the matrices with each other.

This Results to

[ (1)(3) + (5)(5) + (2)(1) ]
[ (2)(3) + (9)(5) + (5)(1) ]
[ (5)(3) + (2)(5) + (6)(1) ]

   [ 3 + 25 + 2 ]
= [ 6 + 45 + 5 ]
   [ 15 + 10 +6]

    [ 30 ]
=  [ 56 ]
    [ 31 ]

Sample Problem #2

       [ 2  7  5 ]
A = [ 1  3  6 ]       B = [ 3  1  8 ]
       [ 3  2  1 ]

Since Matrix A is measured to be 3 x 3, and Matrix B is  1 x 3, we cannot multiply the matrices with each other. Therefore, it is undefined.



Friday, August 1, 2014

Addition of Matrices

If A = [ aij ] and B = [bij ] are matrices of size m x n, then their sum is the m x n matrix given by

A + B = [aij + bij ].


The sum of two matrices of different sizes is undefined.

Examples
a. [  -2   3   ]  +   [   4   2   ]    =   [  -2 + 4,  3 + 2  ]   =  [   2   5   ]
    [   5   8   ]       [  -1   3   ]         [ 5 + (-1), 8 + 3  ]       [  4  11   ]

b. [  -1   6   4  ]   +   [   3   1   6   ]    =   [   2   7   10   ]
    [   4   1   5   ]        [  -8   5   3   ]        [  -4   6   8     ] 

c. [ 1 ]      [ 2 ]       [ 3 ]
    [ 7 ]  +  [ 3 ]  =  [10]
    [ 5 ]      [ 4 ]      [ 9 ]

d. The sum of
       [ 5  1 ]                   [  1  2  6  ]
A = [ 2  3 ]  and  B =    [  4  3  8  ]
       [ 1  4 ]                   [ -1  2  0  ]


is undefined. Because the matrices of both A and B have different sizes.

Friday, July 25, 2014

Network Analysis for Electric Circuits

Determine the currents I1,I2, and I3 for the electrical network.



There are two junctions shown, but both of them are equal, so there is no need to name them as J1 and J2.

The answer is I2 = I1+I3, when we use Network Analysis.

After that, we will use a matrix to solve for the Amperes (I). We will combine the resistances (Rn) shown on the Amperes (In) and make them equal to the amount of their voltage (v) for determining the entries for the matrix. The answers are:

I1 – I2 + I3 = 0 Volts

4I1 + 3I2 = 3 Volts 

1I3 + 3I2 = 4 Volts

Then we use them as entries for the matrix.

[   1  -1   1   0   ]
[   4   3   0   3   ]     -4(R1) + R2 ---> R2
[   0   3   1   4   ]

[   1  -1   1   0   ]
[   0   7  -4   3   ]     -2(R3) + R2 ---> R2     
[   0   3   1   4   ]

[   1  -1   1   0   ]
[   0   1  -6  -5   ]     -3(R2) + R3 ---> R3
[   0   3   1   4   ]

[   1  -1   1   0   ]
[   0   1  -6  -5   ]      1/19 (R3)
[   0   0   19 19  ]

[   1  -1   1   0   ]
[   0   1  -6  -5   ]     R1 + R2 ---> R1
[   0   0   1   1    ] 

[   1   0  -5  -5   ]
[   0   1  -6  -5   ]     5(R3) + R1 ---> R1
[   0   0   1   1    ]

[   1   0   0   0   ]
[   0   1  -6  -5  ]     6(R3) + R2 ---> R2
[   0   0   1   1   ]

[   1   0   0   0   ]
[   0   1   0   1   ]     
[   0   0   1   1   ]

Now we know that:

I1 = 0 Amperes

I2 = 1 Ampere

and

I3 = 1 Ampere


Friday, July 18, 2014

Network Analysis




Below is an example of a network analysis.

In this example, we assume that the circles in the upper part of the picture are 1 and 2 from left to right, while the ones below are 3 and 4 from left to right. The answers are as follows:

J1 300 = x1+x2
J2 x1+x3 = 150+x4
J3 200+x2 = x3+x5
J4 x5+x4 = 350

J is known as the junction. The ones within the junctions are the numbers on the arrows going toward the junction, while the ones not within the junction in the equation are the numbers on the arrows going away from the junction. For example, in J1, 300 is the number on the arrow going toward the junction, while xand xare the numbers on the arrows going away from the said junction. The equation can also be J1 x1+x= 300, since it is also produces the same result.


Friday, July 11, 2014

Translating Large x-Values Before Curve Fitting

Find a polynomial that fits the points

                       (2005, 1)    (2006, 2)   (2007,3)   (2009,4)   (2010,10)

Because the given x-values are large, use the translation z = x - 2007 to obtain
   
                                 (-2, 1)   (-1, 2)   (0, 3)   (2, 4)   (3, 10)

This makes the polynomial functions as
p(-2) = a0 + a1(-2) + a2(-2)2 + a3(-2)3 + a4(-2)4 = a0 - 2a1 + 4a2 – 8a3 + 16a4 = 1
p(-1) = a0 + a1(-1) + a2(-1)2 + a3(-1)3 + a4(-1)4 = a0 - a1 + a2 –  a3 + a4 = 2
p(0) = a+ a1(0) + a2(0)+ a3(0)3 + a4(0)4 = a0 = 3
p(2) = a+ a1(2) + a2(2)+ a3(2)3 + a4(2)4 = a0 + 2a+ 4a2 + 8a3 + 16a4 = 4
p(3) = a+ a1(3) + a2(3)+ a3(3)3 + a4(3)4 = a0 + 3a+ 9a2 + 27a3 + 81a4 = 10

Then use the Gauss-Jordan Elimination. At the end, the solution is a0=3, a1=29/60, a2=-67/120, a3=1/15. and a4=13/120. This means that p(x) = 3 + 29/60x - 67/120x+ 1/15x3 + 13/120x4. But because we used z to translate the x-value, the p(x) is now written as 3 + 29/60(x-2007) - 67/120(x-2007)+ 1/15(x-2007)3 + 13/120(x-2007)4

  
                                                                              
                                                           
1-24-8161
1-11-112
100003
1248164
139278110
    
                       
-1(R1) + R2 ---> R2

1-24-8161
01-37-151
100003
1248164
139278110

-1(R1) + R3 ---> R3

1-24-8161
01-37-151
02-48-162
1248164
139278110

-1(R1) + R4 ---> R4

1-24-8161
01-37-151
02-48-162
0401603
139278110

-1(R1) + R5 ---> R5

1-24-8161
01-37-151
02-48-162
0401603
05535659

-2(R2) + R3 ---> R3

1-24-8161
01-37-151
002-6140
0401603
05535659

-4(R2) + R4 ---> R4

1-24-8161
01-37-151
002-6140
0012-1260-1
05535659

-5(R2) + R5 ---> R5

1-24-8161
01-37-151
002-6140
0012-1260-1
002001404

1/2(R3) ---> R3

1-24-8161
01-37-151
001-370
0012-1260-1
002001404

-12(R3) + R4 ---> R4

1-24-8161
01-37-151
001-370
00024-24-1
002001404

-20(R3) + R5 ---> R5

1-24-8161
01-37-151
001-370
00024-24-1
0006004

1/24(R4)

1-24-8161
01-37-151
001-370
0001-1-1/24
0006004

-60(R4) + R5 ---> R5

1-24-8161
01-37-151
001-370
0001-1-1/24
00006013/2

1/60(R5) ---> R5

1-24-8161
01-37-151
001-370
0001-1-1/24
0000113/120

1(R5) + R4 ---> R4

1-24-8161
01-37-151
001-370
000101/15
0000113/120

-7(R5) + R3 ---> R3

1-24-8161
01-37-151
001-30-91/120
000101/15
0000113/120

15(R5) + R2 ---> R2

1-24-8161
01-37021/8
001-30-91/120
000101/15
0000113/120

-16(R5) + R1 ---> R1

1-24-80-11/15
01-37021/8
001-30-91/120
000101/15
0000113/120

3(R4) + R3 ---> R3

1-24-80-11/15
01-37021/8
00100-67/120
000101/15
0000113/120

-7(R4) + R2 ---> R2

1-24-80-11/15
01-300259/120
00100-67/120
000101/15
0000113/120

8(R4) + R1 ---> R1

1-2400-1/5
01-300259/120
00100-67/120
000101/15
0000113/120

3(R3) + R2 ---> R2

1-2400-1/5
0100029/60
00100-67/120
000101/15
0000113/120

-4(R3) + R1 ---> R1

1-200061/30
0100029/60
00100-67/120
000101/15
0000113/120

-2(R2) + R1 
---> R1
100003
0100029/60
00100-67/120
000101/15
0000113/120