https://github.com/md-emon-hasan/numerical-analysis
🔢 C-based algorithms and exercises focused on numerical methods, such as interpolation, differentiation, and aimed for equation solving.
https://github.com/md-emon-hasan/numerical-analysis
bisection-method false-position fixed-point newton-raphson numerical-analysis numerical-integration numerical-methods
Last synced: about 2 months ago
JSON representation
🔢 C-based algorithms and exercises focused on numerical methods, such as interpolation, differentiation, and aimed for equation solving.
- Host: GitHub
- URL: https://github.com/md-emon-hasan/numerical-analysis
- Owner: Md-Emon-Hasan
- License: mit
- Created: 2024-10-09T07:58:04.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-17T17:47:28.000Z (10 months ago)
- Last Synced: 2024-12-27T01:11:56.814Z (10 months ago)
- Topics: bisection-method, false-position, fixed-point, newton-raphson, numerical-analysis, numerical-integration, numerical-methods
- Language: C
- Homepage:
- Size: 138 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
```markdown
# 📊 Numerical Analysis using C and MATLABWelcome to the **Numerical Analysis** repository! This project contains implementations of various **numerical analysis algorithms** in **C** and **MATLAB**. These methods are fundamental for solving numerical problems like root-finding, interpolation, differentiation, integration, and solving linear systems.
---
## 🚀 **Features**
- ⚙️ Numerical methods implemented in **C** and **MATLAB**.
- 🧮 Algorithms for:
- Root finding (e.g., Bisection, Newton-Raphson).
- Interpolation and polynomial approximations.
- Numerical integration and differentiation.
- Solving linear and non-linear systems.
- 📈 MATLAB scripts for data visualization.
- 💻 Optimized C programs for efficient computation.---
## 🛠️ **Technologies Used**
- **C Programming Language** (for performance and precision)
- **MATLAB** (for visualization and high-level numerical computing)---
## 💻 **Setup and Installation**
### **C Programs**
1. **Compile the programs** using a C compiler like `gcc`:
```bash
gcc bisection_method.c -o bisection
./bisection
```
2. Input the required parameters (equation, intervals, tolerance).### **MATLAB Scripts**
1. Open the `.m` files in MATLAB or **MATLAB Online**.
2. Run the scripts by pressing **Run** or typing in the Command Window:
```matlab
bisection_method
```---
## 📚 **Algorithms Included**
### **Root Finding**
- Bisection Method
- Newton-Raphson Method
- Secant Method### **Interpolation**
- Lagrange Interpolation
- Newton's Divided Difference### **Numerical Integration**
- Trapezoidal Rule
- Simpson's 1/3 Rule### **Linear Systems**
- Gaussian Elimination
- LU Decomposition---
## 📊 **Usage Examples**
### **C Example: Bisection Method**
```c
#include
#includedouble func(double x) {
return x*x - 4; // Example function: x^2 - 4 = 0
}int main() {
double a = 0, b = 3, tol = 0.001, c;while ((b - a) >= tol) {
c = (a + b) / 2;
if (func(c) == 0.0)
break;
else if (func(c) * func(a) < 0)
b = c;
else
a = c;
}
printf("Root: %.5f\n", c);
return 0;
}
```### **MATLAB Example: Newton-Raphson Method**
```matlab
f = @(x) x^2 - 4; % Function definition
df = @(x) 2*x; % Derivative of the function
x0 = 2; % Initial guess
tol = 1e-6; % Tolerance
max_iter = 100;for i = 1:max_iter
x1 = x0 - f(x0)/df(x0); % Newton-Raphson formula
if abs(x1 - x0) < tol
fprintf('Root: %.5f\n', x1);
break;
end
x0 = x1;
end
```---
## 🤝 **Contributing**
Contributions are welcome! Follow these steps:
1. Fork the repository.
2. Clone your fork:
```bash
git clone https://github.com/your-username/Numerical-Analysis.git
```
3. Create a new branch:
```bash
git checkout -b feature-branch
```
4. Add your code and commit:
```bash
git add .
git commit -m "Add feature: feature description"
```
5. Push the changes and create a pull request:
```bash
git push origin feature-branch
```---
## 🌟 **License**
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
---
## 📞 **Contact**
For any queries or suggestions, feel free to reach out:
- **Md Emon Hasan**
- 📧 Email: [iconiemon01@gmail.com](mailto:iconiemon01@gmail.com)
- 🌐 GitHub: [Md-Emon-Hasan](https://github.com/Md-Emon-Hasan)---
## ⭐ **Support**
If you find this repository helpful, give it a **⭐** and share it with your peers!
---
Happy Coding! 🎉
```---
### **Key Additions:**
1. Updated **features** and structure for C and MATLAB.
2. Added **C program** and **MATLAB script** examples for better understanding.
3. Included **usage instructions** and **visualization placeholders**.
4. A clear **folder structure** is outlined for easy navigation.Let me know if you'd like further customization! 🚀