An electrical engineer supervises the production of three

flows in every pipe. Solve the following system of equations to obtain the flow in every stream. Q 3 + 2Q 4 − 2Q 2 = Q 5 + 2Q 6 − 2Q 4 = 3Q 7 − 2Q 6 = 9.15 A truss is loaded as shown in Fig. P9.15. Using the following set of equations, solve for the 10 unknowns, AB, BC , AD, BD, CD, DE, CE, A x , A y , and E y . A x + A D = − 24 − C D − 45C E = 0 A y + A B = − A D + D E − 35B D = 0 74 + BC + 35B D = 0 C D + 45B D = 0 − A B − 45B D = 0 −D E − 35C E = 0 −BC + 35C E = 0 E y + 45C E = 0 PROBLEMS 253 Q 1 Q 3 Q 5 Q 2 Q 4 Q 6 Q 7 FIGURE P9.14 3 m 3 m 4 m D A E C B 74 kN 24 kN FIGURE P9.15 9.16 A pentadiagonal system with a bandwidth of five can be expressed generally as ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ f 1 g 1 h 1 e 2 f 2 g 2 h 2 d 3 e 3 f 3 g 3 h 3 · · · · · · · · · d n− 1 e n− 1 f n− 1 g n− 1 d n e n f n ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ × ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ x 1 x 2 x 3 · · · x n− 1 x n ⎫ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎬ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎭ = ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ r 1 r 2 r 3 · · · r n− 1 r n ⎫ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎬ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎭ Develop an M-file to efficiently solve such systems without pivoting in a similar fashion to the algorithm used for tridiag- onal matrices in Sec. 9.4.1. Test it for the following case: ⎡ ⎢ ⎢ ⎢ ⎢ ⎣ 8 − 2 − 1 − 2 9 − 4 − 1 − 1 − 3 7 − 1 − 2 − 4 − 2 12 − 5 − 7 − 3 15 ⎤ ⎥ ⎥ ⎥ ⎥ ⎦ ⎧ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎩ x 1 x 2 x 3 x 4 x 5 ⎫ ⎪ ⎪ ⎪ ⎪ ⎬ ⎪ ⎪ ⎪ ⎪ ⎭ = ⎧ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎩ 5 2 1 1 5 ⎫ ⎪ ⎪ ⎪ ⎪ ⎬ ⎪ ⎪ ⎪ ⎪ ⎭

9.17 Develop an M-file function based on Fig. 9.5 to im-

plement Gauss elimination with partial pivoting. Modify the function so that it computes and returns the determinant with the correct sign, and detects whether the system is sin- gular based on a near-zero determinant. For the latter, define “near-zero” as being when the absolute value of the determi- nant is below a tolerance. When this occurs, design the func- tion so that an error message is displayed and the function terminates. Here is the functions first line: function [x, D] = GaussPivotNewA, b, tol where D = the determinant and tol = the tolerance. Test your program for Prob. 9.5 with tol = 1 × 10 − 5 . Q 1 = Q 2 + Q 3 Q 3 = Q 4 + Q 5 Q 5 = Q 6 + Q 7 254 LU Factorization CHAPTER OBJECTIVES The primary objective of this chapter is to acquaint you with LU factorization. 1 Specific objectives and topics covered are • Understanding that LU factorization involves decomposing the coefficient matrix into two triangular matrices that can then be used to efficiently evaluate different right-hand-side vectors. • Knowing how to express Gauss elimination as an LU factorization. • Given an LU factorization, knowing how to evaluate multiple right-hand-side vectors. • Recognizing that Cholesky’s method provides an efficient way to decompose a symmetric matrix and that the resulting triangular matrix and its transpose can be used to evaluate right-hand-side vectors efficiently. • Understanding in general terms what happens when MATLAB’s backslash operator is used to solve linear systems. A s described in Chap. 9, Gauss elimination is designed to solve systems of linear algebraic equations: [ A]{x} = {b} 10.1 Although it certainly represents a sound way to solve such systems, it becomes inefficient when solving equations with the same coefficients [A], but with different right-hand-side constants {b}. 1 In the parlance of numerical methods, the terms “factorization” and “decomposition” are synonymous. To be consistent with the MATLAB documentation, we have chosen to employ the terminology LU factorization for the subject of this chapter. Note that LU decomposition is very commonly used to describe the same approach.