I made this originally as a one-off personal project for my CPE2237 Numerical Methods subject somewhere around January 2022, as a simple calculator of this kind and originally only up to 3 decimal places accurate. Only recently I cleaned the code when uploading this.
It is a method used in solving systems of equations iteratively, rather than using the usual Gauss-Jordan elimination method. Since it is iterative, it is fast
even to the largest matrices, at the cost of precision because the
Gauss-Seidel and Gauss-Jacobi are very similar in execution, but the feature that sets them both apart is that the former's
For a 3x3 augmented matrix, where the coefficients (
the formula is:
Where:
-
$a_{ij}$ = Coefficients ($a_{11}, a_{12},$ etc.). -
$b_i$ = Resultant vector's ($B$ ) coefficients ($b_1, b_2,$ etc.). -
$k$ - Iteration №.- The 0th iteration of each
$x$ 's are usually set to 0 or an arbitrary value.
- The 0th iteration of each
The loop stops once the previous iteration's (
A 3x3 matrix is said to be (strictly) diagonally dominant if it satisfies all three of these conditions:
- Make sure you have .NET Core 3.1 or higher (since it uses C# 8.0).
- Make sure you also have ConsoleTables. You can download it from the NuGet package manager.
- Click the latest version on the Releases section and download the source code. Alternatively, click the green code button and download as a ZIP (or you can clone it).
- Open your favorite code editor of your choice (Visual Studio is more recommended than VS Code).
- Open the solution file and then run (Visual Studio) or open the folder of the project and then run the Program.cs file (VS Code and other code editors).
- You can also run it from the terminal but make sure you use Roslyn as the compiler.
- Enjoy!