Graphics Programs Reference
In-Depth Information
18.
+120 V
-120 V
1
50
30
3
2
25
20
4
30
Determine the loop currents i 1 to i 4 in the electrical network shown.
19. Consider the n simultaneousequations Ax
=
b , where
n
1
j ) 2
A i j
=
( i
+
b i
=
A i j
,
i
=
0
,
1
,...,
n
1,
j
=
0
,
1
,...,
n
1
j
=
0
1 T .Write aprogram that solves these equations
for any given n (pivoting is recommended).Runthe programwith n
11
The solutionis x
=
···
=
2, 3 and 4,
and commenton the results.
2.6 Matrix Inversion
Computing the inverse of amatrix and solving simultaneousequations are related
tasks. The most economical way to invert an n
×
n matrix A istosolve the equations
AX
=
I
(2.33)
×
×
where I is the n
n , will be the
inverse of A . The proof issimple:afterwe premultiplyboth sides of Eq. (2.33) by A 1
wehave A 1 AX
n identitymatrix. The solution X , also of size n
A 1 I , which reduces to X
A 1 .
Inversion of largematrices shouldbe avoidedwheneverpossible due its high cost.
As seen fromEq. (2.33), inversion of A isequivalent to solving Ax i =
=
=
n ,
where b i is the i th column of I . If LU decompositionisemployedinthe solution, the
solutionphase (forward and back substitution) must be repeated n times, once for
each b i .Since the cost of computationis proportionalto n 3 for the decomposition
phase and n 2 for each vector of the solutionphase, the cost of inversionisconsiderably
moreexpensivethan the solution of Ax
b i , i
=
1
,
2
,...,
=
b (single constant vector b ).
Search WWH ::




Custom Search