Upload
keila-oldham
View
226
Download
0
Tags:
Embed Size (px)
Citation preview
2
Syllabus
Motivation Steps for Cramer’s Rule Cramer’s Rule: ∆ Cramer’s Rule: Numerator Ni
Cramer’s Rule: Solve for xi
Sample Problem
3
Motivation Circuit analysis involves solution of multiple (n)
linear equations
One way to solve is via algebraic substitution
Which becomes tedious and highly error-prone, once n is interestingly large
Engineering calculators often provide built-in solutions, a method internally using Cramer’s Rule
Yet future engineers must understand the method first; then they should use a calculator
First learn to use determinants to solve n unknowns xi in a set of n linear equations, with i = 1..n
Requirement: n independent equations for n independent unknowns xi
4
Cramer’s Rule Solving Unknowns xi
∆ is the Characteristic Determinant, used in every equation, computing the denominator of xi
N i are the numerators for xi
Then for each xi its equation is: xi = N i / ∆
x1 = N1 / ∆
x2 = N2 / ∆
x3 = N3 / ∆
5
Steps for Cramer’s Rule To start, normalize: Order all equations by
index i of the unknowns xi to be computed Requires a square matrix! If any unknown xi in equation j is not present,
insert it with constant factor ci,j = 0 Compute the characteristic determinant ∆ for
the denominator And then, for each unknown xi compute its
associated numerator determinant Ni
Finally solve for all xi
xi = N i / ∆
6
Steps for Cramer’s Rule
Counting of rows and columns starts at 1; not at 0! Not like the first index of C or C++ arrays!
Unknowns xi are to be computed Constants in each row i that multiply each
unknown xj in column j are shown as ci,j
The right hand side of = forms a separate column vector of result values Ri
7
Equations for Cramer’s Rule, With n=3
x1 * c1,1 + x2 * c1,2 + x3 * c1,3 = R1
x1 * c2,1 + x2 * c2,2 + x3 * c2,3 = R2
x1 * c3,1 + x2 * c3,2 + x3 * c3,3 = R3
The 3 unknowns xi to be computed are x1 x2 x3
8
Cramer’s Rule: ∆ Write the characteristic determinant ∆ by
listing only and all coefficients ci,j in the n rows and n columns
Then write the single column for the vertical Results vector R
|c1,1 c1,2 c1,3|| R1|
∆ = |c2,1 c2,2 c2,3| [R]= | R2||c3,1 c3,2 c3,3|
| R3|
9
Cramer’s Rule: ∆ Pick an arbitrary column, e.g. column 1, then remove
one of its elements ci,1 i=1..n at a time, starting with row 1
Generate the next minor matrix, by eliminating the whole rowi and columnj, initially j = 1; etc. for all rows 1..n
Multiply the remaining minor matrix by that constant ci,1 and by its sign; sign = (-1)row+col here = (-1)i+1
∆ = c1,1 |c2,2 c2,3| - c2,1 |c1,2 c1,3| + c3,1 |c1,2
c1,3|
|c3,2 c3,3| |c3,2 c3,3| |c2,2
c2,3|
∆ = c1,1 * ( c2,2 * c3,3 - c3,2 * c2,3 )
- c2,1 * ( c1,2 * c3,3 - c3,2 * c1,3 )
+ c3,1 * ( c1,2 * c2,3 - c2,2 * c1,3 )
10
Cramer’s Rule: Numerator Ni = N1
Starting with the Characteristic Determinant ∆
Replace ith column for computing xi, and replace that column by result vector [R]; so for x1 we generate:
|R1 c1,2 c1,3|N1 = |R2 c2,2 c2,3|
|R3 c3,2 c3,3|
N1 = R1 |c2,2 c2,3| - R2 |c1,2 c1,3| + R3|c1,2 c1,3|
|c3,2 c3,3| |c3,2 c3,3||c2,2 c2,3|
N1 = R1* ( c2,2 * c3,3 - c3,2* c2,3 )
- R2* ( c1,2 * c3,3 - c3,2* c1,3 )
+ R3* ( c1,2 * c2,3 – c2,2* c1,3 )
11
Cramer’s Rule: Numerator N2
|c1,1 R1 c1,3|N2 = |c2,1 R2 c2,3|
|c3,1 R3 c3,3|
N2 = c1,1 |R2 c2,3| - c2,1 |R1 c1,3| + c3,1 |R1 c1,3| |R3 c3,3| |R3
c3,3| |R2 c2,3|
N2 = c1,1 * ( R2 * c3,3 - R3* c2,3 )
- c2,1 * ( R1 * c3,3 - R3* c1,3 )
+ c3,1 * ( R1 * c2,3 - R2* c1,3 )
12
Cramer’s Rule: Numerator N3
|c1,1 c1,2 R1|N3 = |c2,1 c2,2 R2|
|c3,1 c3,2 R3|
N3 = c1,1 | c2,2 R2 | - c2,1 |c1,2 R1 | + c3,1 |c1,2
R1 | | c3,2 R3 | |c3,2 R3|
|c2,2 R2 |
N3 = c1,1* ( R3 * c2,2 - R2* c3,2 )
- c2,1* ( R3 * c1,2 - R1* c3,2 )
+ c3,1* ( R2 * c1,2 - R1* c2,2 )
13
Cramer’s Rule: Solve for xi
For each xi its equation is: xi = N i / ∆
x1 = N1 / ∆
x2 = N2 / ∆
x3 = N3 / ∆
14
Sample Problem, [1] Appendix A
-9 * v2 - 12 * v3 + 21 * v1 = -33
-2 * v3 + 6 * v2 - 3 * v1 = 3
-8 * v1 + 22 * v3 - 4 * v2 = 50
Below are 3 sample equations for some fictitious circuit
The 3 unknowns vi to be computed are v1 v2 v3
15
Sample Problem, [1] Appendix A
21 * v1 - 9 * v2 - 12 * v3 = -33
-3 * v1 + 6 * v2 - 2 * v3 = 3
-8 * v1 - 4 * v2 + 22 * v3 = 50
All 3 equations normalized, i.e. sorted by index, for unknowns v1 v2 v3
16
Characteristic Determinant ∆
Now write result column and the characteristic determinant ∆ by listing the coefficients ci,j only
|21 -9 -12|| -33 |
∆ = |-3 6 -2| [R]= | 3 |
|-8 -4 22|| 50 |
∆ = 21 | 6 -2 | - (-3) |-9 -12 | -8 |-9-12|
|-4 22 | |-4 22 | | 6 -2|
∆ = 21*(132-8) + 3*(-198-48) - 8*(18+72)
∆ = 2,604 – 738 - 720 = 1,146
17
Numerator N1
Replace column 1 with column vector [R]
|-33 -9 -12|N1 = | 3 6 -2|
| 50 -4 22|
N1 = -33 |6 -2 | - 3 |-9 -12| + 50 |-9 -12|
|-4 22 | |-4 22|| 6 -2|
N1 = -33*(124) - 3*(-246) + 50*(18+72)
N1 = 1,146
18
Numerator N2
Replace column 2 with column vector [R]
|21 -33 -12 |N2 = |-3 3 -2 |
|-8 50 22 |
N2 = 21 | 3 -2 | + 3 |-33 -12| - 8 |-33 -
12| |50 22 | | 50
22| | 3 -2|
Students compute N2 in class!
19
Numerator N2
Replace column 2 with column vector [R]
|21 -33 -12 |N2 = |-3 3 -2 |
|-8 50 22 |
N2 = 21 | 3 -2 | + 3 |-33 -12| - 8 |-33 -
12| |50 22 | | 50
22| | 3 -2|
N2 = 21*(166) + 3*(-126) - 8*(102)
N2 = 3,486 – 378 – 816 = 2,292
20
Numerator N3
Replace column 3 with column vector [R]
|21 -9 -33 |N3 = |-3 6 3 |
|-8 -4 50 |
N3 = 21 | 6 3 | + 3 |-9 -33 | - 8 |-9 -
33 | |-4 50 | |-4 50
| | 6 3 |
Students compute N3 in class!
21
Numerator N3
Replace column 3 with column vector [R]
|21 -9 -33 |N3 = |-3 6 3 |
|-8 -4 50 |
N3 = 21 | 6 3 | + 3 |-9 -33 | - 8 |-9 -
33 | |-4 50 | |-4 50
| | 6 3 |
N3 = 21*(312) + 3*(-582) - 8*(171)
N3 = 6,552 – 1,746 – 1,368 = 3,438
22
Cramer’s Rule: Solve for v1, v2, and v3
For all vi the results are: vi = N i / ∆
v1 = N1 / ∆ = 1,146 / 1,146 = 1 V
v2 = N2 / ∆ = 2,292 / 1,146 = 2 V
v3 = N3 / ∆ = 3,438 / 1,146 = 3 V
23
What if?
What would the result be, if we had expanded the characteristic determinant ∆ along the 3rd column? Let’s see:
|21 -9 -12|∆ = |-3 6 -2|
|-8 -4 22|
∆ = -12 |-3 6 | - (-2) |21 -9 | + 22 |21 -9|
|-8 -4 | |-8 -4 | |-3 6|
∆ = -12*(12+48) + 2*(-84-72) + 22*(126-27)
∆ = -720 – 312 + 2,178 = 1,146 <- same result!!