Skip to main content

Tool that solves ODE's numerically. Written in Python.

Project description

Numerical ODE Solver

This project is a Python implementation for solving ordinary differential equations (ODEs) numerically. The script allows users to choose between two methods: Euler's Method and Runge-Kutta 4th Order Method (RK4), providing a visual representation of the solution (optional). Note: Euler's Method is more inaccurate than RK4.

Requirements

Python version >= 3.8

Ensure the following Python libraries are installed:

Install it using pip:

pip install numODEsolver

Example

import numODEsolver as ns
import matplotlib.pyplot as plt #optional for plot

solver = ns.Solver()
f = solver.get_function("y") 
values = solver.rk4_1order(f,x0=0,y0=1,n=10000,bound=10.1)
n = solver.get_value(values,val=10,dec=5)
print(n)
plt.plot(results[:,0],results[:,1])
plt.show()
from numODEsolver import solver

solver = ns.Solver()
f = solver.get_function("y'+y") #y' = for 1st derivative. The ode would be y'' = y'+y
x,y,dy = solver.euler_2order(f,x0=0,y0=1,dy0=1,n=10000,bound=5)
n = solver.get_value(values,val=3,dec=2)
print(n)

Version History

  • 8.12.2024 - v0.1 -> only 1st order ODE's are solvable, more features coming soon
  • 15.12.2024 - v0.2 -> removed plot function
  • 26.1.2025 - v0.3 -> included 2nd order methods, see more on GitHub
  • 18.03.2025 - v2.0 -> more secure function handeling, more stable numerical methods.

For more documentation take a look at the source code on my GitHub.

You can modify the script to add more methods, or change visualization settings.

Contributions and suggestions are welcome!

Lukas

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numodesolver-2.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

numodesolver-2.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file numodesolver-2.0.1.tar.gz.

File metadata

  • Download URL: numodesolver-2.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for numodesolver-2.0.1.tar.gz
Algorithm Hash digest
SHA256 17320169b17ad2f80abb6a369e5e9919d3084a44a026cd7d2be6256d76c16d6f
MD5 c03474cb49488e30eef301dba3b524b4
BLAKE2b-256 399f98dc4a4b98e9801b1b60f7b2f077d4084a025b85515713445a63d75bd4fd

See more details on using hashes here.

File details

Details for the file numodesolver-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: numodesolver-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for numodesolver-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b73490822ee405263fb338ef65e72e305de90b06c16441f6bd06fac2d0e147e
MD5 b421c0e0456a6d0067ee1e28c8de14af
BLAKE2b-256 febd5f0681d820a1489c746cf7f441307323441f4b2d4c7b96b91df9d24fd9e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page