Roots of equation and Differential equation
Project description
scm203lab267101691 is a lightweight Python package that provides simple utility functions
for The bisection method, Newton's method, 3-order Runge-Kutta method and 4-order Runge-Kutta method.
It is designed mainly for learning purposes and as an example of Python packaging.
Features
- Module 1
- The bisection method: finding root of f in [a,b] with error tolerance
- Newton's method: finding root of f with initial guess x0 and error tolerance
- Module 2
- 3-order Runge-Kutta method: solve the ODE y' = f(t, y) using the 3rd-order Runge-Kutta method.
- 4-order Runge-Kutta method: solve the ODE y' = f(t, y) using the 4th-order Runge-Kutta method.
Installation
You can install the package directly from PyPI:
pip install scm203lab267101691
Examples
import scm203lab267101691 as scm
print("bisection ≈",scm.bisection(lambda x: x**3+x-1,0,1,0.001,10))
print("newton ≈",scm.newton(lambda x: x**3+x-1,lambda x: 3*x**2+1,1,0.001,10))
print(scm.order_3_runge(lambda t, y: y - t**2 + 1, 0, 2, 10, 0.5))
print(scm.order_4_runge(lambda t, y: y - t**2 + 1, 0, 2, 10, 0.5))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scm203lab267101691-0.1.1.tar.gz.
File metadata
- Download URL: scm203lab267101691-0.1.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9729f2de0287a1d2e8b123dcdd989d24a9b716b590d79a8efd008646b724083
|
|
| MD5 |
e966f11461713ccf0ff08ff0f283ef85
|
|
| BLAKE2b-256 |
0cad6bf367ef53482c9619834bb6d211935095c603512f7114989bbea16af8d7
|
File details
Details for the file scm203lab267101691-0.1.1-py3-none-any.whl.
File metadata
- Download URL: scm203lab267101691-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba47a8030d59973f471bbd2bc68c32b7eb894493c8c3ba0c23738c8913b5a2b9
|
|
| MD5 |
db3188d9c7732270c9e9163afc54257a
|
|
| BLAKE2b-256 |
cd769e049cbb1e84c9515dd989fb1f787fe740638e25214a869ef67e99d01c72
|