Skip to content

joha546/Numerical-Methods-Performance-Analysis

Repository files navigation

Numerical Methods Performance Analysis Project

Overview

This project implements and analyzes various numerical methods for solving both linear and non-linear equations. Numerical methods are essential in scientific computing, allowing for the approximation of solutions to mathematical problems that cannot be solved analytically. This project provides a robust set of tools for solving equations, analyzing their performance, and understanding the convergence properties of different methods.

Project Structure

The project is organized as follows:

numerical_methods/
├── main.cpp                    # Entry point of the program
├── linear_equation_solver.cpp   # Implementation of linear equation solving methods
├── linear_equation_solver.h     # Header file for linear equation solving methods
├── non_linear_equation_solver.cpp  # Implementation of non-linear equation solving methods
├── non_linear_equation_solver.h    # Header file for non-linear equation solving methods
├── equation_parser.cpp          # Utility for parsing equations
├── equation_parser.h            # Header file for the equation parser
├── performance_analyzer.cpp     # Tool for analyzing performance (accuracy, convergence, efficiency)
├── performance_analyzer.h       # Header file for the performance analyzer
├── utils.cpp                    # General utility functions
├── utils.h                      # Header file for utility functions
└── CMakeLists.txt               # CMake build configuration file

Implemented Methods

Linear Equations

  • Gaussian Elimination
  • LU Decomposition
  • Jacobi Method
  • Gauss-Seidel Method

Non-Linear Equations

  • Bisection Method
  • Newton-Raphson Method
  • Secant Method
  • Fixed Point Iteration

Performance Analysis

The project includes a performance analyzer that evaluates:

  • Accuracy: Measures how close the computed solution is to the true solution.
  • Convergence Rate: Analyzes how quickly the method converges to the solution.
  • Computational Efficiency: Evaluates the time complexity and resource usage of the method.

Getting Started

Prerequisites

  • C++ Compiler: Ensure you have a C++ compiler that supports C++17 or higher.
  • CMake: You need CMake version 3.10 or higher to build the project.

Building the Project

  1. Clone the Repository

    git clone https://github.com/joha546/Numerical-Methods-Performance-Analysis.git
    cd Numerical-Methods-Performance-Analysis
  2. Create a Build Directory

    mkdir build
    cd build
  3. Generate Build Files

    cmake ..
  4. Build the Project

    cmake --build .
  5. Run the Executable

    ./NumericalMethods

Running the Tests

To verify the correctness of the implementations, you can run tests that compare the computed solutions to known solutions for a set of equations.

  1. Run Unit Tests
    ./NumericalMethods --test

Usage

After building the project, you can run the executable to solve different types of equations. The program will prompt you to input the equation and select the numerical method you wish to use. It will then compute the solution and display performance metrics.

Example Usage

  • Solving a Linear Equation using Gaussian Elimination

    Enter the linear system (in matrix form):
    [1 2 3]
    [4 5 6]
    [7 8 9]
    
    Select method: 
    1. Gaussian Elimination
    2. LU Decomposition
    ...
    
  • Solving a Non-Linear Equation using Newton-Raphson Method

    Enter the non-linear equation (e.g., x^3 - 5x + 3 = 0):
    x^3 - 5x + 3 = 0
    
    Select method:
    1. Bisection Method
    2. Newton-Raphson Method
    ...
    

How This Project is Helpful

  • Educational Tool: This project is an excellent resource for students and professionals looking to deepen their understanding of numerical methods. It provides both implementations and performance analysis, making it easier to compare and contrast different methods.

  • Research and Development: Researchers can use this project as a foundation for experimenting with new numerical methods or improving existing ones.

  • Real-World Applications: The methods implemented in this project can be used in various fields such as physics, engineering, finance, and any domain that requires solving complex equations.

How to Improve This Project

  • Expand the Library of Methods: Add more numerical methods for solving differential equations, optimization problems, or eigenvalue problems.

  • Enhance the Performance Analyzer: Incorporate more advanced metrics like memory usage or numerical stability, and support multi-threading for performance benchmarking.

  • Improve User Interface: Develop a graphical user interface (GUI) using a toolkit like Qt or a web interface to make the tool more user-friendly.

  • Optimize Code: Refactor the codebase to improve efficiency, perhaps by using advanced data structures or parallel processing.

How to Contribute

Contributions are welcome! Here’s how you can get involved:

  1. Fork the Repository

    • Click the "Fork" button on the repository's GitHub page to create a copy of the project in your GitHub account.
  2. Clone Your Fork

    git clone https://github.com/joha546/Numerical-Methods-Performance-Analysis.git
    cd Numerical-Methods-Performance-Analysis
  3. Create a New Branch

    git checkout -b feature-your-feature-name
  4. Make Your Changes

    • Implement a new feature, fix bugs, or improve documentation.
  5. Commit and Push

    git add .
    git commit -m "Description of changes"
    git push origin feature-your-feature-name
  6. Submit a Pull Request

    • Go to the original repository on GitHub, click the "New Pull Request" button, and provide a description of your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • This project was developed as part of an academic exercise in Numerical Analysis.
  • Special thanks to all contributors who helped improve this project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published