Review• The inverse A−1of a matrix A is, if it exists, characterized byAA−1= A−1A = In.•a bc d−1=1ad − bcd −b−c a• If A is inver tible, then the system Ax = b has the unique solution x = A−1b.• Gauss–Jordan method to compute A−1:◦ bring to RREF [A I] I A−1 • (A−1)−1= A• (AT)−1= (A−1)T• (AB)−1= B−1A−1Why? Because (B−1A−1)(AB) = B−1IB = B−1B = IFurther propertie s of matrix inversesTheorem 1. Let A be an n × n m atrix. Then the following statements are equiva-lent: (i.e., for a givenA, they are either all true or all false)(a) A is invertibl e .(b) A is row eq uivalent to In.(c) A has n pivots. (E asy to check!)(d) For every b, the system Ax = b has a uni que solution.Namely,x = A−1b.(e) There is a matrix B such that AB = In. (A has a “right inverse”.)(f) There is a matrix C such that CA = In. (A has a “left inverse”.)Note. Matrices that are not invertible are often called singular.The book uses singular for n × n matrices that do not ha ve n pivots. As we just saw, it doesn’ tmake a difference.Example 2. We now see at once that A =0 10 0is not invertible.Why? Because it h as only one pivot.Armin [email protected]: finite differencesLet us apply linear algebra to the boundary v alue problem (BVP)−d2udx2= f(x), 0 6 x 6 1, u(0) = u(1) = 0.f(x)is given, a nd the goal i s to find u(x).Physica l interpretation: models steady-state te mperature distribution in a bar (u(x) is te mperatureat pointx) under influence of an external heat source f (x) and with ends fixed at 0◦(ice cube atthe ends?) .Remark 3. Note that this simp le BVP can be solved by integrating f(x) twice. We gettwo constants of integrati o n, and so we see that the boundary condition u(0) = u( 1 ) = 0makes the solution u(x) unique.Of course, in the real applications the BVP would be harder. Also,f (x) might only be known atsome points, so we cannot use calculus to integrate it.u(x)x 1We will approximate this problem as follows:• replace u(x) by its values at equally spaced points in [0, 1]u0= 0u1= u(h)u2= u(2h)u3= u(3h)un= u(nh)un+1= 0. . .0 h 2h 3h nh 1• approximated2udx2at these points (finite differences)• replace differential equation with linear equation at each point• solve linear proble m using Gaussian eliminatio nArmin [email protected] differencesFinite diffe r e n ces for first de r ivative:dudx≈∆u∆x=u(x + h) − u(x)h@o ru(x) − u(x − h)h@o ru(x + h) − u(x − h)2hsymmetric and most accurateNote. Recall that you can al ways use L’Hospital’s rule to determine the limit of suchquantities (especially more complicated ones) ash → 0.Finite diffe r e n ce for s e c ond derivative:d2udx2≈u(x + h) − 2u(x) + u(x − h)h2the only symmetric ch oice invol ving only u(x), u(x ± h)Question 4. Wh y does this a pproximated2udx2as h → 0?Solution.d2udx2≈dudx(x + h) −dudx(x)h≈u(x + h) − u(x)h−u(x) − u(x − h)hh≈u(x + h) − 2u(x) + u(x − h)h2Armin [email protected] up the linear equations−d2udx2= f(x), 0 6 x 6 1, u(0) = u(1) = 0.u0= 0u1= u(h)u2= u(2h)u3= u(3h)un= u(nh)un+1= 0. . .0 h 2h 3h nh 1Using −d2udx2≈ −u(x + h) − 2u(x) + u(x − h)h2, we get:atx = h:−u(2h) − 2u(h) + u(0)h2= f(h)2u1− u2= h2f(h) (1)atx = 2h:−u(3h) − 2u(2h) + u(h)h2= f (2h)−u1+ 2u2− u3= h2f(2h) (2)atx = 3h:−u2+ 2u3− u4= h2f(3h) (3)at x = nh:−u((n + 1)h) − 2u(n h) + u((n − 1)h)h2= f(nh)−un−1+ 2un= h2f(nh) (n)Example 5. In the case of six di visions (n = 5, h =16), we get:2 −1−1 2 −1−1 2 −1−1 2 −1−1 2Au1u2u3u4u5x=h2f(h)h2f(2h)h2f(3h)h2f(4h)h2f(5h)bArmin [email protected] a matrix is called a band matrix. As we will see next, such matrices always havea particularly simple LU decom position.Gaussian eliminatio n:2 −1−1 2 −1−1 2 −1−1 2 −1−1 2>1121111R2→ R2+12R12 −1032−1−1 2 −1−1 2 −1−1 2>1123111R3→ R3+23R22 −1032−1043−1−1 2 −1−1 2>1113411R4→ R4+34R32 −1032−1043−1054−1−1 2>1111451R5→ R5+45R42 −1032−1043−1054−1065In conclusion, we have the LU decomposition:2 −1−1 2 −1−1 2 −1−1 2 −1−1 2=1−121−231−341−4512 −132−143−154−165That’s h ow the LU decomposition of band matrice s always looks like.Armin
View Full Document