1. Trang chủ
  2. » Công Nghệ Thông Tin

solution of linear equations using gaussian elimination

17 348 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 17
Dung lượng 714,5 KB

Nội dung

Solution of linear equations using Gaussian elimination FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Home HOME Introduction Gaussian Elimination Method Gaussian Elimination Procedure Programming Exercise Resources FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Learning Objectives Learning objectives in this module 1. Develop problem solution skills using computers and numerical methods 2. Review the Gaussian elimination method for solving simultaneous linear equations 3. Develop programming skills using FORTRAN New FORTRAN elements in this module -use of NAG-library FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Introduction Solution of sets of linear equations is required in many petroleum applications. Many methods exist for this purpose, direct methods as well as iterative methods. The reference mentioned in the end may be consulted for a review of such methods. A direct method frequently used in petroleum applications is the Gaussian elimination method, and the simplest form of this method will be discussed below. First, let’s review the concept of simultaneous linear equations. A set of linear simultaneous equations may be written as: a 11 x 1 +a 12 x 2 + a 13 x 3 + + a 1N x N = d 1 a 21 x 1 + a 22 x 2 + a 23 x 3 + + a 2N x N = d 2 a 31 x 1 + a 32 x 2 + a 33 x 3 + + a 3N x N = d 3 a M 1 x 1 + a M 2 x 2 + a M 3 x 3 + + a MN x N = d M . . . . . . . FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Introduction  Here we have a total of N unknowns (x j , j=1, 2… N), related through M equations. The coefficients in the left sides of the equations (a ij , i=1, 2… N ; j=1, 2… M ) are known parameters, and so are also the coefficients on the right side (b i , i=1, 2… M). a 11 x 1 +a 12 x 2 + a 13 x 3 + + a 1N x N = d 1 a 21 x 1 + a 22 x 2 + a 23 x 3 + + a 2N x N = d 2 a 31 x 1 + a 32 x 2 + a 33 x 3 + + a 3N x N = d 3 a M 1 x 1 + a M 2 x 2 + a M 3 x 3 + + a MN x N = d M . . . . . . . FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Introduction The equations may alternatively be written in a compact form: where A is the coefficient matrix, and b is the right hand side vector: A⋅ x = b  A = a 11 a 12 a 1N a 21 a 22 a 2N a M 1 a M 2 a MN               b = b 1 b 2 b M               x = x 1 x 2 x M               If the number of unknowns is equal to the number of equations, N=M , we may be able to solve the set of equations, provided that the equations are unique. Gaussian Elimination Method FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Gaussian elimination method For simplicity, let’s use the following set of 3 equations and 3 unknowns, ie. N=3 and M=3, in order to illustrate the Gaussian elimination method: The method starts by multiplying Eq. (4) by –a 21 /a 11 and then add it to Eq. (5). The resulting equation becomes: We then multiply Eq.(4) by and add it to Eq.(6), resulting in: a 11 x 1 + a 12 x 2 + a 13 x 3 = d 1 a 21 x 1 + a 22 x 2 + a 23 x 3 = d 2 a 31 x 1 + a 32 x 2 + a 33 x 3 = d 3 (4) (5) (6) ′ a 22 x 2 + ′ a 23 x 3 = ′ d 2 ′ a 32 x 2 + ′ a 33 x 3 = ′ d 3 FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Gaussian elimination method The set of equation has now become Next, we multiply Eq. (8) by –a’ 32 /a’ 22 and add it to Eq. (9), so that the set of equations become: This completes the first part of the Gaussian elimination method, called the forward elimination process. a 11 x 1 + a 12 x 2 + a 13 x 3 = d 1 ′ a 22 x 2 + ′ a 23 x 3 = ′ d 2 ′ a 32 x 2 + ′ a 33 x 3 = ′ d 3 (7) (8) (9) a 11 x 1 + a 12 x 2 + a 13 x 3 = d 1 ′ a 22 x 2 + ′ a 23 x 3 = ′ d 2 ′ ′ a 33 x 3 = ′ ′ d 3 (10) (11) (12) Continue to the Second Part FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Gaussian elimination method Eq. (12) may now be used to solve directly for x 3 : After completion of the forward elimination process, determined the last unknown of the vector (x 3 ) by Eq. (13), we will perform a back substitution process. This simply means that as the unknowns are calculated, in our simple example from x 3 and downwards, they are substituted into the equations above, and the next unknown may be computed. For Eqs. (12) and (11) this process is carried out as follows: Based on the example above, we may formulate a general procedure for the forward elimination, solution for the last unknown, and back substitution to get the rest of the unknowns x 3 = ′ ′ d 3 / ′ ′ a 33 x 2 = ( ′ d 2 − ′ a 23 x 3 ) / ′ a 22 x 1 = (d 1 − a 12 x 2 − a 13 x 3 ) / a 11 (13) (14) (15) Gaussian Elimination Procedure FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Gaussian elimination procedure 1) Forward elimination: 2) Solving for x N : 3) Back substitution:  a i, j = a i,j + a k,j − a i,k a k,k       , j = k +1,n ( ) , i = k +1,n [ ] , k =1,n −1  d i = d i + d k − a i,k a k ,k       , i = k +1,n ( ) , k = 1,n − 1  x N = d N a N,N  x i = 1 a i,i d i − a i, j j=i+1 n ∑ x j       , i = n −1, ,1 [...]... Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Resources Title: Solution of linear equations using Gaussian elimination Teacher(s): Professor Jon Kleppe Assistant(s): Per Jørgen Dahl Svendsen Abstract: Provide a good background for solving problems within petroleum related topics using numerical methods 4 keywords: Linear equations, Gaussian elimination, ... University Press, 1992 Gaussian elimination method Gaussian elimination procedure Programming exercise Resources References to the textbook :  Gauss Jordan elimination:  Gaussian Elimination with backsubstitution: Info FAQ page 27 page 33 Reference s Summary Summary Learning Objectives Introduction Subsequent to this module you should Gaussian elimination method Gaussian elimination procedure Programming... Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Make a FORTRAN program consisting of a main program, that reads the coefficients of the system of equations (n, a1,1…an,n , d1…dn) from an input file (IN.DAT) and writes the results (x1…xn) to an out-file (OUT.DAT), and a subroutine, SUBROUTINE GAUSS(X,A,D,N), that uses the Gaussian elimination method... solve the set of equations and returns n values of x to the main program Resources Test the program on the following set of equations: Push 2x +3y +4z -5s +7t = -35 8x -2y -3z +9s +3t = +53 4y +6z -3s -2t = -33 5x -7y +8z +3s -9t = -19 3x +5y -2z +4s +6t = +27 Continue Info FAQ Reference s Summary Programming Exercise Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure... Petra-server includes a NAG-library of scientific subroutines Find a subroutine in this library (use naghelp) that may be used for solution of simultaneous equations (Gaussian elimination method or some other method) Modify the program above so that is asks you on the screen if you want to use the programmed Gaussian- routine or the NAG-routine for the solution Check that the solutions from the two methods... Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Introduction to Fortran Fortran Template here Fort ran T pl at e em The whole exercise in a printable format here Solu t ion of l in ear Resources equ at ion u sin g Gau ssi Web sites  Numerical Recipes In Fortran  Fortran Tutorial  Professional Programmer's Guide to Fortran77... must be in agreement with the responsible author or in agreement with http://www.learningjournals.net About the author Info FAQ Reference s Summary FAQ Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Resources No questions have been posted yet However, when questions are asked they will be posted here Remember, if something is unclear to... Topic discipline: Level: 2 Prerequisites: None Learning goals: Develop problem solution skills using computers and numerical methods Size in megabytes: 0.6 MB Software requirements: MS Power Point 2002 or later, Flash Player 6.0 Estimated time to complete: Copyright information: The author has copyright to the module and use of the content must be in agreement with the responsible author or in agreement... Summary Learning Objectives Introduction Subsequent to this module you should Gaussian elimination method Gaussian elimination procedure Programming exercise Resources     be familiar with the Gaussian Elimination Method have a good feel for how Nag routines are used know how to efficiently use subroutines have obtained a better understanding on solving problems in Fortran Info FAQ Reference s Summary . Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise General information Title: Solution of linear equations using Gaussian elimination Teacher(s): Professor. Solution of linear equations using Gaussian elimination FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming. NAG-library FAQ Reference s SummaryInfo Resources Learning Objectives Introduction Gaussian elimination method Gaussian elimination procedure Programming exercise Introduction Solution of sets of linear equations is required in many petroleum

Ngày đăng: 24/10/2014, 21:28

TỪ KHÓA LIÊN QUAN