Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Numerical Methods Calculator in C

A console-based numerical methods calculator developed in the C programming language.

The application provides multiple numerical analysis methods for root finding, matrix operations, solving linear equation systems, numerical differentiation, and numerical integration.

Features

  • Polynomial input using coefficients and exponents
  • Bisection method
  • Regula Falsi method
  • Newton-Raphson method
  • Matrix inversion
  • Gauss-Jordan elimination
  • Gauss-Seidel iterative method
  • Backward numerical differentiation
  • Central numerical differentiation
  • Forward numerical differentiation
  • Simpson's 1/3 rule
  • Simpson's 3/8 rule
  • Trapezoidal integration
  • Console-based menu system

Technologies Used

  • C Programming Language
  • Numerical Analysis
  • Root-Finding Algorithms
  • Matrix Operations
  • Iterative Methods
  • Numerical Differentiation
  • Numerical Integration
  • Structures
  • Arrays
  • Standard C Libraries

Implemented Methods

Root-Finding Methods

  • Bisection Method
  • Regula Falsi Method
  • Newton-Raphson Method

These methods approximate the roots of polynomial functions.

Matrix Operations

  • Inverse of an N × N matrix
  • Gauss-Jordan elimination
  • Gauss-Seidel iterative solution

Numerical Differentiation

The program supports:

  • Backward difference
  • Central difference
  • Forward difference

Numerical Integration

The program supports:

  • Simpson's 1/3 Rule
  • Simpson's 3/8 Rule
  • Trapezoidal Rule

Project Structure

numerical-methods-calculator-c/
├── main.c
├── project-report.pdf
└── README.md

How to Run Using Dev-C++

  1. Download the repository.
  2. Open main.c in Dev-C++.
  3. Click Compile & Run.
  4. Select a numerical method from the menu.
  5. Enter the requested values.

How to Compile Using GCC

Because the program uses the mathematical functions from math.h, compile it with:

gcc main.c -o numerical-methods -lm

How to Run on Windows

numerical-methods.exe

How to Run on Linux or macOS

./numerical-methods

Menu Options

0. Exit
1. Bisection Method
2. Regula Falsi Method
3. Newton-Raphson Method
4. Inverse of an N × N Matrix
5. Gauss-Jordan Elimination
6. Gauss-Seidel Method
7. Numerical Differentiation
8. Simpson's Method
9. Trapezoidal Method
10. Gregory-Newton Interpolation

Polynomial Input Example

For the polynomial:

f(x) = 2x³ - 4x + 1

Enter:

Number of terms: 3

Term 1:
Coefficient: 2
Exponent: 3

Term 2:
Coefficient: -4
Exponent: 1

Term 3:
Coefficient: 1
Exponent: 0

Example Root-Finding Input

For the Bisection Method:

Starting point: 0
Ending point: 2
Epsilon: 0.001
Maximum iterations: 100

Important Notes

  • The maximum polynomial term count is currently limited to 10.
  • The maximum matrix size is currently limited to 10 × 10.
  • Simpson's 1/3 Rule should use an even number of subdivisions.
  • Simpson's 3/8 Rule should use a subdivision count divisible by 3.
  • Newton-Raphson requires a suitable initial value.
  • Some methods may fail when the selected interval or matrix is invalid.
  • The Gregory-Newton Interpolation menu option is present, but its implementation is currently incomplete.

Main Functions

  • DegerPolynomial() — Evaluates a polynomial at a given value
  • bisectionMethod() — Finds a root using the Bisection Method
  • regulaFalsiMethod() — Finds a root using the Regula Falsi Method
  • newtonRaphsonMethod() — Finds a root using Newton-Raphson
  • matrix_inverse() — Calculates a matrix inverse
  • performGaussJordanElimination() — Solves linear equations
  • gaussSeidelMethod() — Applies the Gauss-Seidel iterative method
  • numericalDerivative() — Calculates numerical derivatives
  • simpsonMethod() — Applies Simpson's integration rules
  • trapezoidalMethod() — Applies the Trapezoidal Rule

Author

Ali Hasanli
Computer Engineering Student

About

A C-based numerical methods calculator implementing root-finding, matrix operations, numerical differentiation, and numerical integration techniques.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages