Skip to content

aCoderFromAnotherWorld/NumericalAssignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<title>Numerical Methods Console Application</title> <style> body { font-family: Arial, sans-serif; margin: 0 2em; } h1, h2, h3, h4 { color: #333; } ul { list-style-type: none; padding: 0; } li { margin: 0.5em 0; } code { background-color: #f4f4f4; padding: 0.2em 0.4em; border-radius: 4px; } </style>

Numerical Methods Console Application

This console application, written in C++, provides implementations of several numerical methods for solving linear equations, non-linear equations, differential equations, and performing matrix inversion. All methods are modularly included in header files for easy integration and usage.

Table of Contents

Solution of Linear Equations

Jacobi Iterative Method

The Jacobi method is an iterative technique to solve a system of linear equations. Each equation is solved for a specific variable, assuming the remaining variables' values are constant in each iteration. This method is suitable for diagonally dominant matrices.

Gauss-Seidel Iterative Method

The Gauss-Seidel method is similar to the Jacobi method, but each variable is updated as soon as a new value is available in each iteration. This often results in faster convergence than the Jacobi method.

Gauss Elimination

The Gauss elimination method transforms a system of linear equations into an upper triangular matrix form. The solution can then be found using back-substitution. This method is one of the most commonly used elimination techniques.

Gauss-Jordan Elimination

Gauss-Jordan elimination extends Gauss elimination by transforming the matrix into a reduced row-echelon form. This allows for a direct reading of the solution without needing back-substitution.

LU Factorization

LU factorization decomposes a matrix into the product of a lower triangular matrix (L) and an upper triangular matrix (U). This decomposition simplifies solving systems of linear equations, matrix inversions, and calculating matrix determinants.

Solution of Non-linear Equations

Bisection Method

The bisection method is a root-finding method that repeatedly divides an interval and selects a subinterval in which a root exists. The interval is chosen based on the change of sign of the function, ensuring that a root lies within the interval.

False Position Method

The false position method is similar to the bisection method but uses a secant line instead of the midpoint to find the root. This can converge faster for certain types of functions compared to bisection.

Secant Method

The secant method is a root-finding algorithm that uses a sequence of roots of secant lines to approximate the solution. This method doesn’t require knowledge of the derivative and can be faster than the bisection method.

Newton-Raphson Method

The Newton-Raphson method uses the function's derivative to find successively better approximations to the root. It is known for its rapid convergence, although it requires an initial guess close to the actual root for best results.

Solution of Differential Equations

Runge-Kutta Method

The Runge-Kutta method is a popular technique for numerically solving ordinary differential equations (ODEs). The fourth-order Runge-Kutta is particularly well-known for its accuracy and stability, using four evaluations of the derivative per step to improve approximation.

Matrix Inversion

Matrix inversion involves finding a matrix that, when multiplied with the original matrix, yields the identity matrix. The Gauss-Jordan elimination technique is commonly used for inverting matrices, especially when dealing with square matrices.

Requirements

  • C++ Compiler

How to Run

Include the required header files in your project directory:

#include "2107100.hpp"
#include "2107086.hpp"
#include "2107102.hpp"

Run the main function provided below, which offers a console-based user interface to select and execute the different numerical methods.

Usage Example

Start the Application

Run the program to open the console-based interface.

Select a Numerical Method

  • You will be prompted with a list of main categories:
    • Solution For Linear Equations
    • Solution of Non-linear Equations
    • Solution of Differential Equations
    • Matrix Inversion
    • Exit

Choose a Sub-method

  • Selecting Solution For Linear Equations will list options such as:
    • Jacobi Iterative Method
    • Gauss-Seidel Iterative Method
    • Gauss Elimination
    • Gauss-Jordan Elimination
    • LU Factorization
  • Similarly, choosing Solution of Non-linear Equations or Solution of Differential Equations will prompt for the specific method to use, such as:
    • Bisection Method
    • Secant Method
    • Newton-Raphson Method
    • Runge-Kutta Method for differential equations

View Results

After selecting a method, input any required parameters as prompted by the console. The program will execute the method and display the results directly.

  • Video for explaning the app shortly in 2 minute: Click Here
  • Exit the Program

    Select Exit to close the application.

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Contributors 2

    •  
    •  

    Languages