Metadata-Version: 2.1
Name: pynumint
Version: 0.0.1
Summary: pynumint Test Package for Numerical Integration Demo
Home-page: UNKNOWN
Author: Arjun Jagdale
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# pynumint: A Numerical Integration Library

pynumint is a Python library for numerical integration methods.
pynumint offers a wide range of numerical integration methods, including trapezoidal rule, Simpson's rule, midpoint rule, Boole's rule, Romberg integration, and Gauss-Legendre quadrature. Users can choose the most suitable method based on the characteristics of the function and the desired level of accuracy.

## Installation

```bash

pip install pynumint

```

## Usage
```bash

from pynumint import trapezoidal_rule, simpsons_rule, midpoint_rule, booles_rule, romberg_integration, gauss_legendre_quadrature
import numpy as np

# Define your functions to be integrated
def f1(x):
    return x**2

def f2(x):
    return np.sin(x)

def f3(x):
    return np.exp(-x**2)

# Define integration limits and number of intervals
a = 0
b = 10
n = 1000

# Example usage of numerical integration methods
result_trapezoidal = trapezoidal_rule(f1, a, b, n)
result_simpsons = simpsons_rule(f2, a, b, n)
result_midpoint = midpoint_rule(f3, a, b, n)
result_booles = booles_rule(f1, a, b, n)
result_romberg = romberg_integration(f2, a, b)
result_gauss_legendre = gauss_legendre_quadrature(f3, a, b, 5)

print("Results:")
print(f"Trapezoidal Rule: {result_trapezoidal}")
print(f"Simpson's Rule: {result_simpsons}")
print(f"Midpoint Rule: {result_midpoint}")
print(f"Boole's Rule: {result_booles}")
print(f"Romberg Integration: {result_romberg}")
print(f"Gauss-Legendre Quadrature: {result_gauss_legendre}")

```

## Output
```bash 

Trapezoidal Rule: The integral of f1(x) from 0 to 1 is approximately 0.45969765582371824
Simpson's Rule: The integral of f2(x) from 0 to 1 is approximately 0.7468241328124364
Midpoint Rule: The integral of f3(x) from 0 to 1 is approximately 0.7853981842307807
Boole's Rule: The integral of f1(x) from 0 to 1 is approximately 0.45969769413186057
Romberg Integration: The integral of f2(x) from 0 to 1 is approximately 0.7468241330950943
Gauss-Legendre Quadrature: The integral of f3(x) from 0 to 1 is approximately 0.7853981599711883

```



