SOLUTION OF LINEAR ALGEBRAIC EQUATIONS I. Hajj 2017 Linear - - PowerPoint PPT Presentation

solution of linear algebraic equations
SMART_READER_LITE
LIVE PREVIEW

SOLUTION OF LINEAR ALGEBRAIC EQUATIONS I. Hajj 2017 Linear - - PowerPoint PPT Presentation

ECE 552 Numerical Circuit Analysis Chapter Three SOLUTION OF LINEAR ALGEBRAIC EQUATIONS I. Hajj 2017 Linear Equation Solution Methods Consider a set of n linear algebraic equations Ax = b where A is a real or complex n x n nonsingular matrix.


slide-1
SLIDE 1

ECE 552 Numerical Circuit Analysis Chapter Three

SOLUTION OF LINEAR ALGEBRAIC EQUATIONS

  • I. Hajj 2017
slide-2
SLIDE 2

Linear Equation Solution Methods

Consider a set of n linear algebraic equations Ax = b where A is a real or complex n x n nonsingular matrix. There are many ways of solving Ax =b I. Direct Methods: Cramer’s Rule, Inverse, Gaussian Elimination or LU Factorization, Sparse Matrix Techniques II. Iterative or Relaxation Methods: Gauss-Jacobi; Gauss-Seidel, Projection Methods ...

slide-3
SLIDE 3

Dot or Inner Product

slide-4
SLIDE 4

Outer Product

slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7

(1) Cramer's Rule

Computationally very expensive.

(2) Compute the inverse A-1, then for every b, x = A-1b

Note: The inverse can be obtained by transforming:

Then A-1 ≡ B

Also computationally expensive, but much less than Cramer’s Rule

slide-8
SLIDE 8

Using the inverse: x = A-1 b

  • Computing A-1 requires n3 operations (we’ll prove this later)
  • The computation of x = A-1 b requires n2 operations.

Total: n3 + n2 operations Storage: n2 for A, n2 for A-1, n for b and n for x; total = 2(n2 + n)

  • An operation is considered a multiplication or a division, not

counting additions and subtractions, which are almost as many as multiplications and divisions in solving Ax = b.

slide-9
SLIDE 9

If A is sparse (i.e., the percentage of nonzero elements in A is small), then A-1, in general, is full and the solution process still requires n3 + n2 operation and 2(n2 + n) storage locations. A more efficient method, from both computation and storage, is to use

Gaussian Elimination or LU factorization

slide-10
SLIDE 10

Gaussian Elimination

slide-11
SLIDE 11
slide-12
SLIDE 12

Final result of elimination:

  • r U x = z

Solution of Ux = z by Backward Substitution:

xn = zn xn-1 = zn-1 – un-1, xn x1 = z1 – u12x2 – u13x3 … -u1nxn

slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16

Suppose b changes, while A remains unchanged.

Question: Is it possible to solve for the new x without repeating

all the elimination steps since the U matrix remains the same, and only b, and subsequently z, changes? The answer is YES: Save the operations that operate on b to generate the new z. How? Save the lower part of the "triangular" matrix.

slide-17
SLIDE 17

More formally

slide-18
SLIDE 18

Both L and U are stored in place of A

slide-19
SLIDE 19

Summary of Solution Steps Ax = b

  • Factorize A = LU è (LUx = b)
  • Forward Substitution: Lz = b, where Ux ≡ z
  • Backward Substitution: Solve Ux = z
  • Factorization is always possible when A is nonsingular,

provided pivoting is allowed. Pivoting will be explained later.

  • Factorization is not unique
  • There are different ways and different implementations,

depending on computer architecture and on memory access. The solution, however, is unique.

slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26

Remarks

1. The matrices L and U can overwrite the values aij of A. There is no need to provide separate storage locations for A and for its factors L and U. There is no need to store the diagonal unit entries of U or L. 2. If only the right-hand-side vector b is changed, there is no need to repeat the factorization step; only the forward and backward substitutions need to be performed.

slide-27
SLIDE 27

Determinant of A

  • det A = det (LU) = det L det U
  • det A = l11 × l22 × … × lnn (if U has 1s
  • n diagonal
  • det A = u11 × u22 × … × unn (if L has 1s
  • n diagonal
slide-28
SLIDE 28

Other Factorization Procedures (Doolittle’s and Crout’s)

slide-29
SLIDE 29

Gauss Algorithm

slide-30
SLIDE 30

Doolittle Algorithm

slide-31
SLIDE 31

Crout Algorithm

slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37

Transpose Systems

  • The solution of the transpose system

ATx = c can be found by using the same LU factors of A.

  • ATx = (LU)Tx = UTLTx = c
  • Forward substitution: Solve UTz = c
  • Backward substitution: Solve LTx = z
slide-38
SLIDE 38

Remark

  • Transpose systems are used in small-

change sensitivity calculations and

  • ptimization.
slide-39
SLIDE 39

Operation Count

Useful identities

slide-40
SLIDE 40

Number of operations in LU factorization

è (assume L and U are full)

Count divisions and multiplications only. Number of additions and subtractions is almost equal to the number

  • f divisions and multiplications
slide-41
SLIDE 41

Forward and Backward Substitutions

slide-42
SLIDE 42

Pivoting

(1) For Numerical Accuracy and Stability (2) For Sparsity Preservation

slide-43
SLIDE 43

(1) Pivoting for numerical stability

(a) To avoid division by zero Example

slide-44
SLIDE 44

Pivoting for numerical stability (cont.)

  • Pivoting for numerical stability to offset

computation errors caused by round-off errors due to computer word length.

  • WILKINSON: “To minimize round-off errors in Gaussian

elimination it is important to avoid growth in the size of aij(k+1) and bi(k+1) .” That is, the pivot should not be ‘too’ small.

slide-45
SLIDE 45

Different types of pivoting

(1) Complete pivoting: Ax = b

slide-46
SLIDE 46
  • Complete pivoting can be used with

GAUSS’ algorithm, but not with CROUT’S and DOOLITTLE’S.

  • In complete pivoting the order of the

variables and the rhs may change according to the reordering.

slide-47
SLIDE 47

Partial Pivoting

(2) Row Pivoting At the k-th step in the factorization process choose i.e., choose the largest element in column k as a pivot by performing row interchange.

slide-48
SLIDE 48

Different types of pivoting (cont.)

  • In row pivoting the order of the variables

remains the same, while the order of the rhs changes accordingly.

  • Row pivoting can be used with GAUSS’,

CROUT’S, and DOOLITTLES.

slide-49
SLIDE 49

Different types of pivoting (cont.)

(3) Column Pivoting

slide-50
SLIDE 50

Different types of pivoting (cont.)

  • In column pivoting the order of the variables

changes, while the order of the rhs remains the same.

  • Column pivoting can be used with GAUSS’,

CROUT’S, and DOOLITTLE’S.

slide-51
SLIDE 51

Different types of pivoting (cont.)

(4) Diagonal Pivoting

slide-52
SLIDE 52

Different types of pivoting (cont.)

  • Diagonal pivoting requires both row and column

interchanges in a symmetrical way. It is used, for example, to preserve symmetry. Both the orders of the variables and the rhs change accordingly.

  • Diagonal pivoting can be used with GAUSS’, but not

with CROUT’S or DOOLITTLE’S.

  • Diagonally dominant matrices require no pivoting to

maintain numerical stability. The reduced matrix remains diagonally dominant.

  • Pivoting, however, may be necessary to maintain

sparsity (explained later).

slide-53
SLIDE 53

Different types of pivoting (cont.)

  • The nodal admittance matrix of a circuit with no controlled

sources is diagonally dominant (e.g., power system load flow equations).

  • Diagonal dominance depends on equation and variable
  • rdering, i.e., diagonal dominance may be destroyed (or created)

by pivoting (other than diagonal pivoting). Example:

slide-54
SLIDE 54

Why is pivoting possible?

  • Theorem: If at any step in the factorization process, a

column or a row of the reduced matrix is zero, then A is singular.

  • In other words, if A is nonsingular, then it is always

possible to carry out complete, row, or column pivoting (but not necessarily diagonal pivoting).

  • In some cases all the nonzero elements in the reduced

matrix are small => matrix could be ill-conditioned.

  • Advice: Always use double-precision
slide-55
SLIDE 55

Pivoting and Permutation Matrix

  • Row pivoting amounts to multiplying matrix

A by a permutation matrix P: PAx =Pb

  • P is a reordered identity matrix
  • Example

P can be encoded as a row vector pr =[2 4 1 3]

slide-56
SLIDE 56

Pivoting and Permutation Matrix

  • Column pivoting amounts to post-

multiplying matrix A by a permutation matrix Q: AQ

  • Q is a reordered identity matrix
  • Example

Q can be encoded as a row vector qc =[3 1 4 2]

slide-57
SLIDE 57

Pivoting and Permutation Matrix

  • Complete pivoting

PAQ

  • Diagonal pivoting

PAPT

slide-58
SLIDE 58

Condition Number

If is small, A is well-conditioned => Solution can be obtained accurately If Is large, A is ill-conditioned => Solution not accurate

slide-59
SLIDE 59

Residual Error and Accuracy

  • Residual error: r = b – Ax(s)

=>Small ||r|| indicates convergence

  • Accuracy is related to number of correct decimal

digits in solution, related to condition number

  • In circuit simulation small ||r|| is more important,

and Gaussian elimination with pivoting is adequate.

slide-60
SLIDE 60

Improving Accuracy

slide-61
SLIDE 61

Solution Updating

(used in large-change sensitivity calculations and other applications)

  • Suppose the LU factors of A and the solution xo
  • f Ax = b are known.
  • Suppose A is “perturbed” (or some entries

changed); find the new solution from LU and xo.

slide-62
SLIDE 62

Sherman-Morrison-Woodbury (Householder) Formula

New Solution of

( We’ll prove later)

slide-63
SLIDE 63

Solution Updating Algorithm

  • Given x° and LU factors of A
  • (1) Solve AV = P => V = A-1P
  • (2) Form (D-1 + QTV) ≡H
  • (3) Form y = QTxo
  • (4) Solve Hz = y

← k x k system

  • (5) xnew = xo - Vz
slide-64
SLIDE 64

Proof of Housholder formula

Back substitute:

OR

slide-65
SLIDE 65

Applications:

  • Design,
  • optimization,
  • tolerance,
  • statistical analysis,
  • reliability studies,
  • failure analysis,
  • .....................

Sensitivity Analysis of Linear Resistive Circuits and Linear RLC Circuits in the Frequency Domain: Linear Algebraic Systems

slide-66
SLIDE 66

Large-Change Sensitivity

  • Let F(p) represent a scalar output function of a system,

where p is the set of system parameters. Let p° be the nominal value of p.

  • F(p° + ∆p) - F(p°)

Large-change sensitivity of F(p) with respect to p at p = p°

  • Apply solution updating method
slide-67
SLIDE 67

Solution Updating Algorithm

slide-68
SLIDE 68

Example on Large-Change Sensitivity Calculation

  • Find large-change sensitivity of V1 and V2 wrt ∆g2.

Find the “Nominal Solution”:

slide-69
SLIDE 69

Example on Large-Change Sensitivity Calculation (cont.)

slide-70
SLIDE 70

Example on Large-Change Sensitivity Calculation (cont.)

slide-71
SLIDE 71

Example on Large-Change Sensitivity Calculation (cont.)

slide-72
SLIDE 72

Small-Change Sensitivity

  • small-change sensitivity of F(p) with respect to p at p = p°

If F(p) is available as an explicit function of p, then the sensitivities, both small and large, could be computed in a straight-forward manner. Usually, such an explicit function is not available.

  • Consider a linear algebraic system described by:

A(p)x = b where A could be real or complex.

slide-73
SLIDE 73

Small-Change Sensitivity (Cont.)

Suppose the output is a linear combination of the system variables: a linear combination of the rows of the sensitivity matrix. The output could also be a vector xout = ETx.

slide-74
SLIDE 74

Small-Change Sensitivity (Cont.)

Differentiate system equations A(p) x = b with respect to p: (evaluated at nominal solution x = x°, p = p°) Suppose xout = eTx, then

slide-75
SLIDE 75

Algorithm

1. Solve Ax = b at p = p° and find LU and x° 2. Construct 3. Solve the adjoint system (or transpose) ATu = e → UTLTu = e (i.e., uT= eTA-l)

slide-76
SLIDE 76

Example

  • Find the small-change sensitivity of vout with respect to

g1, g2, and g3.

  • Suppose we use nodal analysis, then
slide-77
SLIDE 77

Example (cont.)

(1) Find nominal solution: (2) Construct

Constructed from the stamp connectivity

slide-78
SLIDE 78

Example (cont.)

(3) Solve ATu = e (Adjoint system)

slide-79
SLIDE 79

Nonlinear Performance Function

  • If the performance function is nonlinear

ϕ = f(x, p) (the system is still linear), then and are evaluated at xo and po. is computed by the small-change sensitivity algorithm.

slide-80
SLIDE 80

Partitioning and Block Decomposition

slide-81
SLIDE 81

Partitioning and Block Decomposition

slide-82
SLIDE 82

Partitioning and Block Decomposition

slide-83
SLIDE 83

Bordered-Block Diagonal Form

Node Tearing: In general:

slide-84
SLIDE 84

Branch Tearing

slide-85
SLIDE 85

Floating Subcircuit

slide-86
SLIDE 86

Bordered-Block Diagonal Form

slide-87
SLIDE 87

Solution of BBD Equations: Subcircuit Eqns. Factorization and Forward Subst

slide-88
SLIDE 88

Subcircuit Equations

Terminal representation of the subcircuit at the tearing points

slide-89
SLIDE 89

Solution of BBD Equations: Alg. I

slide-90
SLIDE 90

Solution of BBD Equations: Alg. I (cont.)

slide-91
SLIDE 91

Solution of BBD Equations: Alg. II

slide-92
SLIDE 92

Solution of BBD Equations: Alg. II (cont.)

slide-93
SLIDE 93

Solution of BBD Equations: Alg. III

slide-94
SLIDE 94

Solution of BBD Equations: Alg. III (cont.)

slide-95
SLIDE 95

Nested Decomposition

  • Also known as:

Nested Dissection Domain Decomposition

slide-96
SLIDE 96

Nested Decomposition