Simultaneous Linear Equations Gaussian Elimination 1 Gaussian Elimination

  • Slides: 25
Download presentation
Simultaneous Linear Equations Gaussian Elimination 1

Simultaneous Linear Equations Gaussian Elimination 1

Gaussian Elimination One of the most popular techniques for solving simultaneous linear equations of

Gaussian Elimination 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

Forward Elimination The goal of Forward Elimination is to transform the coefficient matrix into

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

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

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

Forward Elimination Transform to an Upper Triangular Matrix Step 1: Eliminate x 1 in

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

Forward Elimination Zeroing out the coefficient of x 1 in the 2 nd equation.

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

This procedure is repeated for the remaining equations to reduce the set of equations

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 x 1 Pivot = (a( j, 1)/a(1, 1)) For i=1: var+1 a( j , i) = a( j , i) - (pivot * a(1, i) ) End end

Forward Elimination Step 2: Eliminate x 2 in the 3 rd equation. Equivalent to

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

Forward Elimination Continue this procedure by using the third equation as the pivot equation

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

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

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

Forward Elimination At the end of the Forward Elimination steps

Forward Elimination At the end of the Forward Elimination steps

Back Substitution The goal of Back Substitution is to solve each of the equations

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

Back Substitution Start with the last equation because it has only one unknown Solve

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

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

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

For z= var : -1 : 1 sum= 0 For w=z+1 : var Sum

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

Example: Rocket Velocity The upward velocity of a rocket is given at three different

Example: Rocket Velocity The upward velocity of a rocket is given at three different times Time, t Velocity, v s m/s 5 106. 8 8 177. 2 12 279. 2

Example: Rocket Velocity Forward Elimination: Step 1 Yields

Example: Rocket Velocity Forward Elimination: Step 1 Yields

Example: Rocket Velocity Forward Elimination: Step 1 Yields

Example: Rocket Velocity Forward Elimination: Step 1 Yields

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

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

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

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

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

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

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

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

Example: Rocket Velocity Solution: The solution vector is The polynomial that passes through the

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

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

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