Métodos directos para la solución de sistemas de ecuaciones lineales
1. DIRECT METHODS FOR SOLVING SYSTEMS OF LINEAR EQUATIONS Presented by: Acosta CreusMileidy Lorena 2073699 Teacher: Ph.D. Eduardo Carrillo Zambrano Numerical Methods in Petroleum Engineering INDUSTRIAL UNIVERSITY OF SANTANDER 2010
2. CONTENT CONVENTIONAL METHODS OF SOLUTION 1.1. Mathematical background 1.2. Solving Small Numbers Of Equations 1.2.1. Graphical method 1.2.2. Cramer’s rule 1.2.3. Elimination of Unknowns
3. CONTENT 2. TECHIQUES FOR IMPROVING SOLUTIONS 2.1. Use of more significant figures 2. 2.Pivoting 2.3. Scaling 3. COMPLEMENTARY TECHNIQUES 3.1. Gauss-Jordan 3.2. LU Decomposition 4. BIBLIOGRAPHY
4. 1. CONVENTIONAL METHODS OF SOLUTION 1.1. MATHEMATICAL BACKGROUND Matriz An matrix A of mxn is a rectangular array of mn numbers arranged in m rows and n columns. The component or element ij of A, denoted by aij is the number that appears in the row i and column j of A. SCHOOL OF PETROLEUM ENGINEERING
11. 1.2.1. Graphical Method A graphical solution is obtainable for two equations by plotting them on Cartesian coordinates with one axis corresponding to x1 and the other to x2, because each equation is a straight line. 2 3 5 a11x1 + a12x2 = b1 a21 x1 + a22x2 = b2 Despejando x2 SCHOOL OF PETROLEUM ENGINEERING
12. 1.2.1. Graphical Method Beyond three equations, graphical methods break down and, consequently, have little practical value for solving simultaneous equations. There are three cases that can pose problems when solving sets of linear equations: 2 3 5 -1/2x1+ x2= 1 -1/2x1 + x2 = 1/2 x2 x2 x2 (-2.3/5)x1+ x2= 1.1 -1/2x1 + x2 = 1 -1/2x1+ x2= 1 -x1+ 2x2= 2 x1 x1 x1 a) No solution b) Infinite solutions c) ill-conditioned system SCHOOL OF PETROLEUM ENGINEERING
14. 1.2.2. Cramer’s rule Each unknown in a system of linear algebraic equations may be expressed as a fraction of two determinants with denominator D and with the numerator obtained from D by replacing the column of coefficients of the unknown in question by the constants b1, b2,…,bn. For example, 2 3 5 Gabriel Cramer FUENTE: http://auladeblanca.blogspot.com SCHOOL OF PETROLEUM ENGINEERING
16. 1.2.2. Cramer’s rule 2 3 Tosolvetheminors: Evaluatingthedeterminant 2 3 A1=11.90.30.5=1(0.5)-1.9(0.3)=-0.07 A1=0.51.90.10.5=0.5(0.5)-1.9(0.1)=0.06 A1=0.510.10.3=0.5(0.3)-1(0.1)=0.05 These can be used to evaluate the determinant, so: 5 D=0.3(-0.07)-0.52(0.06)+1(0.05) D=-0.0022 SCHOOL OF PETROLEUM ENGINEERING
17. 1.2.2. Cramer’s rule 4 Employing Cramer’s rule: x1=−0.010.5210.6711.9−0.440.30.5−0.0022=0.03278−0.0022=-14.9 x2=0.3−0.0110.50.671.90.1−0.440.5−0.0022=0.0649−0.0022=-29.5 x3=0.30.52−0.010.510.670.10.3−0.445−0.0022=−0.04356−0.0022=19.8 2 3 «For more thanthreeequations, Cramer´s rule becomesimpractcalbecause, as thenumber of equatiomsincreases, thedeterminants are time consumingtoevaluatebyhand» 5 SCHOOL OF PETROLEUM ENGINEERING
18. 1.2.3. Elimination of Unknowns The basic strategy is to multiply the equations by constants so that one of the unknowns will be eliminated when the two equations are combined. The result is a single equation that can be solved for the remaining unknown. 2 3 a11x1 + a12x2 = b1 a21a11x1 + a21a12x2 = b1a21 a21 x1 + a22x2 = b2 a21a11x1 + a22a11x2= b1a11 5 SCHOOL OF PETROLEUM ENGINEERING
19. 1.2.1. Elimination of Unknowns 2 EXAMPLE: Withelimination of unknownse: 3 3x1 + 2x2 = 18 - x1 + 2x2 = 2 5 Usingthelastequations: 𝑥1=218−2(2)32−2(−1)=4 𝑥2=32−18(−1)32−2(−1)=3 Thesevaluesare equalstographicalmethods. SCHOOL OF PETROLEUM ENGINEERING
20. 2. TECHIQUES FOR IMPROVING SOLUTIONS ESCUELA DE INGENIERÍA DE PETRÓLEOS
22. 3.1. GAUSS-JORDAN Gaussian elimination is an algorithm of linear algebra to determine the solutions of a system of linear equations, matrices and inverse found. STEPS 1 To convert linear equation system to banded matrix ESCUELA DE INGENIERÍA DE PETRÓLEOS
23. 3.1. GAUSS-JORDAN 2 Go to the leftmost nonzero column 3 If the first line has a zero in this column, swap it with another that does not have ESCUELA DE INGENIERÍA DE PETRÓLEOS
24. 3.1. GAUSS-JORDAN 4 Get zeros below the pivot, adding appropriate multiples of row than the row below it ESCUELA DE INGENIERÍA DE PETRÓLEOS
25. 3.1. GAUSS-JORDAN 3 Repeat the operations with of the other rows to obtain the higher triangular matrix 3 Starting with the last line is not zero, move up to get the identity matrix. ESCUELA DE INGENIERÍA DE PETRÓLEOS
26. 3.1. GAUSS-JORDAN 3 Solution of the system of equations ESCUELA DE INGENIERÍA DE PETRÓLEOS
27. 3.1. GAUSS-JORDAN EXAMPLE To find the unknowns of the linear equation system using the method Gauss-Jordan Solution ESCUELA DE INGENIERÍA DE PETRÓLEOS
31. 3.2. LU DECOMPOSITION The primary appeal of LU decomposition is that the time-consuming elimination step can be formulated so that it involves only operations on the matrix of coefficients (A), Thus it is well suited for those situations where many right-hand-side vectors (B) must be evaluated for a single value of (A). STEPS 1 The linear equation system can be rearranged to give [A][x]=[B] ESCUELA DE INGENIERÍA DE PETRÓLEOS
32. 3.2. LU DECOMPOSITION 2 Assume that there is a lower diagonal matrix with 1’s on the diagonal [L][D]=[B] L=100𝑙1210𝑙13𝑙231 3 To express the linear equation system as an upper triangular system [U][x]=[D] 𝑈=𝑢11𝑢12𝑢130𝑢22𝑢2300𝑢∗𝑥1𝑥2𝑥3=𝑑1𝑑2𝑑3 ESCUELA DE INGENIERÍA DE PETRÓLEOS
33. 3.2. LU DECOMPOSITION Summary of steps [A] [X]= [B] [U] [L] [L] [D]= [B] [U] [X]= [D] [X] a) Decomposition b) Forwards c) Backward [ D ] Substitution ESCUELA DE INGENIERÍA DE PETRÓLEOS
34. 3.2. LU DECOMPOSITION Consider solving the system of equations by LU decomposition EXAMPLE Solution ESCUELA DE INGENIERÍA DE PETRÓLEOS
35. 3.2. LU DECOMPOSITION Ux=y So, Finally, the solution to the linear system is given: ESCUELA DE INGENIERÍA DE PETRÓLEOS