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.
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
- Gaussian Elimination
- LU Decomposition
- Jacobi Method
- Gauss-Seidel Method
- Bisection Method
- Newton-Raphson Method
- Secant Method
- Fixed Point Iteration
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.
- 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.
-
Clone the Repository
git clone https://github.com/joha546/Numerical-Methods-Performance-Analysis.git cd Numerical-Methods-Performance-Analysis
-
Create a Build Directory
mkdir build cd build
-
Generate Build Files
cmake ..
-
Build the Project
cmake --build .
-
Run the Executable
./NumericalMethods
To verify the correctness of the implementations, you can run tests that compare the computed solutions to known solutions for a set of equations.
- Run Unit Tests
./NumericalMethods --test
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.
-
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 ...
-
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.
-
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.
Contributions are welcome! Here’s how you can get involved:
-
Fork the Repository
- Click the "Fork" button on the repository's GitHub page to create a copy of the project in your GitHub account.
-
Clone Your Fork
git clone https://github.com/joha546/Numerical-Methods-Performance-Analysis.git cd Numerical-Methods-Performance-Analysis
-
Create a New Branch
git checkout -b feature-your-feature-name
-
Make Your Changes
- Implement a new feature, fix bugs, or improve documentation.
-
Commit and Push
git add . git commit -m "Description of changes" git push origin feature-your-feature-name
-
Submit a Pull Request
- Go to the original repository on GitHub, click the "New Pull Request" button, and provide a description of your changes.
This project is licensed under the MIT License - see the LICENSE file for details.
- This project was developed as part of an academic exercise in Numerical Analysis.
- Special thanks to all contributors who helped improve this project.