Presentation is loading. Please wait.

Presentation is loading. Please wait.

LU method 1) factor (decompose) A into L and U 2) given b, determine d 3) using Ux=d and backsubstitution, solve for x Advantage: Once you have L and U,

Similar presentations


Presentation on theme: "LU method 1) factor (decompose) A into L and U 2) given b, determine d 3) using Ux=d and backsubstitution, solve for x Advantage: Once you have L and U,"— Presentation transcript:

1 LU method 1) factor (decompose) A into L and U 2) given b, determine d 3) using Ux=d and backsubstitution, solve for x Advantage: Once you have L and U, can use many different b’s

2 1 4 23 5 a bg d F 14 F 23 F 12 F 24 F 45 FHFH F 35 F 25 F V2 F V1

3 Assume weight of 100 is localized at node 2

4

5 Matrix inverse Square matrix A Inverse of A is A -1

6 How do we get inverse? One way is through LU decomposition and backsubstitution Solve Ax=b with, sequentually Put together x’s to get inverse

7 Example:

8 To get inverse, solve using different b’s

9

10 Now

11

12 Finally

13

14 So the inverse is Check

15 Matrix inverse is useful for determining condition number (ill conditioned) of matrix 1) Normalize rows of matrix to 1. If elements of A -1 are >> 1, probably ill conditioned 2) if A -1 A is not close to I, probably ill conditioned 3) if (A -1 ) -1 is not A, probably ill conditioned

16 A little more technical Norms - a way to measure “size” or “length” of a quantity for matrices, use matrix norm

17 Condition number comes from matrix norm If cond[A] is much bigger than 1, ill conditioned

18 Matrix inverse is time consuming to calculate A number of methods to avoid it I.e Gauss elimination instead of

19 Special matrices Banded matrices Tridiagonal matrices

20 Tridiagonal matrices important for time evolution of systems E.g traffic flow 30 nodes (stoplights) Traffic at node x i at next time (x i,t+1 ) depends on 1) # of cars at x i at time t (x i,t ) 2) # of cars at x i-1 at time t (x i-1,t ) 3) # of cars at x i+1 at time t (x i+1,t )

21 Some linear relationship or

22 Put all 30 equations together Solve to get # of cars, and repeat to see how traffic responds to boundary conditions

23 Thomas algorithm to solve tridiagonal matrices

24 Basically sets up an LU decomposition three parts 1) decomposition 2) forward substitution 3) backward substitution

25 1) decomposition loop from rows 2 to n a i = a i /b i-1 b i = b i -a i *c i-1 end loop 2) forward substitution loop from 2 to n r i = r i - a i *r i-1 end loop

26 3) back substitution x n = r n /b n loop from n-1 to 1 x i = (r i -c i *x i+1 )/b i end loop

27 Example First decompose T

28 loop from rows 2 to 5 a i = a i /b i-1 b i = b i -a i *c i-1 end loop

29 forward substitution loop from 2 to n r i = r i - a i *r i-1 end loop

30 back substitution x n = r n /b n loop from n-1 to 1 x i = (r i -c i *x i+1 )/b i end loop


Download ppt "LU method 1) factor (decompose) A into L and U 2) given b, determine d 3) using Ux=d and backsubstitution, solve for x Advantage: Once you have L and U,"

Similar presentations


Ads by Google