We have developed a comprehensive Python package for solving Ordinary Differential Equations (ODEs) using various numerical methods. This package efficiently handles both first-order and second-order ODEs, implementing methods such as Euler’s Method, Modified Euler’s Method (Heun’s Method), Runge-Kutta Methods (RK2, RK4), Taylor Series Method, Milne’s Predictor-Corrector Method, Adams-Bashforth Predictor-Corrector Method, and Runge-Kutta for Second-Order ODEs. Designed for students, researchers, and professionals in Applied Mathematics, Engineering, and Computational Science, it provides high accuracy and performance in solving differential equations. The package is ideal for mathematical modeling, engineering simulations, and computational science applications, where analytical solutions are impractical.
Dr. R.P. Singh and Dr. Harshita Madduri ( Assistant Professor, Department of Mathematics NIT Kurukshetra )
Mamta Saini (M.Sc. Mathematics NIT Kurukshetra, ML and DA expert)
Numerical Methods for Solving Ordinary Differential Equations (ODEs) in Python
This repository contains Python implementations of various numerical methods for solving first-order and second-order ordinary differential equations (ODEs).
def euler(f):
... # Implementation of Euler's method
def modified_euler(f):
... # Implementation of Modified Euler's method
def rk2(f):
... # Implementation of RK2 method
def rk4(f):
... # Implementation of RK4 method
$ git clone https://github.com/manojms3063/ODE-solver-python-package
$ cd ODE-solver-python-package
$ pip install numpy sympy
import numpy as np
import sympy as smp
from (folder name where you have saved all 3 files) import euler, rk4, ...
def f(x, y):
return x + y
rk4(f)
To create your own Python package:
from setuptools import setup, find_packages
setup(
name='numerical_ode_methods',
version='1.0',
packages=find_packages(),
install_requires=['numpy', 'sympy'],
)
$ python setup.py sdist bdist_wheel
$ twine upload dist/*