Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Simultaneous Linear Equations Gaussian Elimination.

Similar presentations


Presentation on theme: "1 Simultaneous Linear Equations Gaussian Elimination."— Presentation transcript:

1 1 Simultaneous Linear Equations Gaussian Elimination

2 One of the most popular techniques for solving simultaneous linear equations of the form Consists of 2 steps 1. Forward Elimination of Unknowns. 2. Back Substitution

3 Forward Elimination The goal of Forward Elimination is to transform the coefficient matrix into an Upper Triangular Matrix

4 Forward Elimination Linear Equations A set of n equations and n unknowns..

5 Forward Elimination Transform to an Upper Triangular Matrix Step 1: Eliminate x 1 in 2 nd equation using equation 1 as the pivot equation Which will yield

6 Forward Elimination Zeroing out the coefficient of x 1 in the 2 nd equation. Subtract this equation from 2 nd equation Pivot = (a(2,1)/a(1,1)) For i=1:var+1 i:all element in the same equation a(2,i) = a(2,i) - (pivot * a(1,i) ) end

7 This procedure is repeated for the remaining equations to reduce the set of equations as... For j=1+1:var j: all equations 1: to eleminate x1 Pivot = (a( j,1)/a(1,1)) For i=1:var+1 a( j,i) = a( j,i) - (pivot * a(1,i) ) End end

8 Forward Elimination Step 2: Eliminate x 2 in the 3 rd equation. Equivalent to eliminating x 1 in the 2 nd equation using equation 2 as the pivot equation. This procedure is repeated for the remaining equations to reduce the set of equations

9 Forward Elimination Continue this procedure by using the third equation as the pivot equation and so on. For nx=1:var-1 xn:all the x in all equations For j=nx+1:var j: all equations Pivot = (a( j,nx)/a(nx, nx)) For i=1:var+1 i:all element in the same equation a( j,i) = a( j,i) - (pivot * a(nx,i) ) End end

10 At the end of (n-1) Forward Elimination steps, the system of equations will look like:..

11 Forward Elimination At the end of the Forward Elimination steps

12 Back Substitution The goal of Back Substitution is to solve each of the equations using the upper triangular matrix. Example of a system of 3 equations

13 Back Substitution Start with the last equation because it has only one unknown Solve the second from last equation using x n solved for previously. This solves for x n-1.

14

15 Back Substitution Representing Back Substitution for all equations by formula For i=n-1, n-2,….,1 and

16 For z= var : -1 : 1 sum= 0 For w=z+1 : 1 : var Sum =sum+(a(z,w)*x(w)) End X(z)= (a(z,4)- sum) / a(z,z) end

17 Example: Rocket Velocity The upward velocity of a rocket is given at three different times Time, tVelocity, v s m/s 5106.8 8177.2 12279.2

18 Example: Rocket Velocity Forward Elimination: Step 1 Yields

19 Example: Rocket Velocity Yields Forward Elimination: Step 1

20 Example: Rocket Velocity Yields This is now ready for Back Substitution Forward Elimination: Step 2

21 Example: Rocket Velocity Back Substitution: Solve for a 3 using the third equation

22 Example: Rocket Velocity Back Substitution: Solve for a 2 using the second equation

23 Example: Rocket Velocity Back Substitution: Solve for a 1 using the first equation

24 Example: Rocket Velocity Solution: The solution vector is The polynomial that passes through the three data points is then:

25 Example: Rocket Velocity Solution: Substitute each value of t to find the corresponding velocity


Download ppt "1 Simultaneous Linear Equations Gaussian Elimination."

Similar presentations


Ads by Google