Question: (input) How to write a Fortran code? Programming tasks Implement the Gaussian elimination algorithm without pivoting as described in the lecture notes The algorithm should

(input) How to write a Fortran code? Programming tasks Implement the Gaussianelimination algorithm without pivoting as described in the lecture notes The algorithm(input)

How to write a Fortran code?

Programming tasks Implement the Gaussian elimination algorithm without pivoting as described in the lecture notes The algorithm should be implemented in a separate subroutine "gaussElim", which is to be contained in a module linearSolvers". Your subroutine should conform to the following interface specifications receive the LHS matrix A (as a 2D array) and the RHS vector c (as a 1D array): e return the solution x ( return an integer error code indicating success/failure of the algorithm. as a 1D array); Test your subroutine using the examples from t he notes. For this, use a main program that: reads the matrix A and vector c from a file linear-system" in" (available from MyUni); . uses ALLOCATABLE arrays to store the matrix in the main program; e writes the results to a file "solution.txt" (this code structure make good sense, especially as you gain experience with programming, but if you are still struggling with programming, use a simpler approach so that you know what you are doing) Important note Although the notes/slides do contain significant portions of a Gaussian elimination code, you are advised to develop your own code from scratch. This effort will advance your programming skills much more than if you just copy-paste an existing code and tweak it, and will pay off when facing the sheer increase in programming complexity that can be anticipated in Assignments 2 4 Analysis tasks 1. Check your newly developed code against at least 2 examples from the notes, and against 1 test problem of your own design. Provide a brief justification of your choice of test problems. 2. Ensure your code does not crash when small pivots are encountered (hint: you want to avoid division by zero and return an intelligent message to the user if this happens) Extension task 1. If you are comfortable programming, augment the Gaussian elimination subroutine with a partial pivoting procedure. Describe the logistics of this upgrade, i.e., what sequence of work steps did you undertake when incorporating partial pivoting and why. Programming tasks Implement the Gaussian elimination algorithm without pivoting as described in the lecture notes The algorithm should be implemented in a separate subroutine "gaussElim", which is to be contained in a module linearSolvers". Your subroutine should conform to the following interface specifications receive the LHS matrix A (as a 2D array) and the RHS vector c (as a 1D array): e return the solution x ( return an integer error code indicating success/failure of the algorithm. as a 1D array); Test your subroutine using the examples from t he notes. For this, use a main program that: reads the matrix A and vector c from a file linear-system" in" (available from MyUni); . uses ALLOCATABLE arrays to store the matrix in the main program; e writes the results to a file "solution.txt" (this code structure make good sense, especially as you gain experience with programming, but if you are still struggling with programming, use a simpler approach so that you know what you are doing) Important note Although the notes/slides do contain significant portions of a Gaussian elimination code, you are advised to develop your own code from scratch. This effort will advance your programming skills much more than if you just copy-paste an existing code and tweak it, and will pay off when facing the sheer increase in programming complexity that can be anticipated in Assignments 2 4 Analysis tasks 1. Check your newly developed code against at least 2 examples from the notes, and against 1 test problem of your own design. Provide a brief justification of your choice of test problems. 2. Ensure your code does not crash when small pivots are encountered (hint: you want to avoid division by zero and return an intelligent message to the user if this happens) Extension task 1. If you are comfortable programming, augment the Gaussian elimination subroutine with a partial pivoting procedure. Describe the logistics of this upgrade, i.e., what sequence of work steps did you undertake when incorporating partial pivoting and why

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!