Problem

Gauss Elimination. The accuracy of the Gauss elimination technique can be improved using a...

Gauss Elimination. The accuracy of the Gauss elimination technique can be improved using a process called pivoting. To perform row pivoting, we first reorder the equations so that the equation with the largest absolute value for the first coefficient is the first equation. We then eliminate the first variable from the equations that follow the first equation. Then, starting with the second equation, we reorder the equations such that the second equation has the largest coefficient (in absolute value) for the second variable. We then eliminate the second variable from all equations after the second equation. The process continues similarly for the rest of the variables. Assume that a symbolic constant N contains the number of equations.

Figure: Temperature grid in a metal plate.

Modify the function developed for Problem 1 so that column pivoting is performed before each variable is eliminated. Use the function developed in Problem 2.

Problem 1

Gauss Elimination. The accuracy of the Gauss elimination technique can be improved using a process called pivoting. To perform row pivoting, we first reorder the equations so that the equation with the largest absolute value for the first coefficient is the first equation. We then eliminate the first variable from the equations that follow the first equation. Then, starting with the second equation, we reorder the equations such that the second equation has the largest coefficient (in absolute value) for the second variable. We then eliminate the second variable from all equations after the second equation. The process continues similarly for the rest of the variables. Assume that a symbolic constant N contains the number of equations.

Figure: Temperature grid in a metal plate.

Use the program developed in Section as a guide to develop a function that receives a double array a of size N by N. A second parameter is a double array soln of size N. The function should solve the system of equations represented by array a, and return the solution in array soln. Assume that the corresponding function prototype is

void gauss(double a[N][N+1],double soln[N]);

Problem 2

Gauss Elimination. The accuracy of the Gauss elimination technique can be improved using a process called pivoting. To perform row pivoting, we first reorder the equations so that the equation with the largest absolute value for the first coefficient is the first equation. We then eliminate the first variable from the equations that follow the first equation. Then, starting with the second equation, we reorder the equations such that the second equation has the largest coefficient (in absolute value) for the second variable. We then eliminate the second variable from all equations after the second equation. The process continues similarly for the rest of the variables. Assume that a symbolic constant N contains the number of equations.

Figure: Temperature grid in a metal plate.

Column pivoting is performed in a similar fashion to row pivoting: by exchanging columns such that the largest coefficient (in absolute value) will be in the position of interest. When columns are exchanged, it is important to keep track of the changes in the order of the variables. Write a function to perform column pivoting. Include parameters to specify changes in the order of the variables. Assume that the corresponding function prototype is

void pivot_c(double a[N][N+1],int j,int reorder k[N]);

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search