Numerical PDE Solver
Overview
This package provides numerical solutions to Partial Differential Equations (PDEs) using Euler and Milstein methods, tailored for use in financial mathematics and other fields requiring the numerical solution of stochastic differential equations.
Installation
Install this package by running:
pip install numerical-pde-solver
## Usage
from numerical_pde_solver.euler import euler_method
# Define your drift and diffusion functions
def f(x, t):
# Drift coefficient function
return -x
def g(x, t):
# Diffusion coefficient function
return 0.1
# Initial condition, start time, end time, and step size
x0, t0, T, dt = 0, 0, 1, 0.01
# Solve the SDE
t, x = euler_method(f, g, x0, t0, T, dt)
# Now `t` holds the time points, and `x` holds the solution at those points
from numerical_pde_solver.milstein import milstein_method
# Define your drift and diffusion functions for the SDE
def f(x, t):
# Drift coefficient function as a placeholder example
return 0.05 * x
def g(x, t):
# Diffusion coefficient function as a placeholder example
return 0.2 * x
# Define the partial derivative of the diffusion function with respect to x
def dg(x, t):
# For the diffusion term g(x, t) = 0.2 * x, the derivative with respect to x is 0.2
return 0.2
# Initial condition, start time, end time, and step size
x0, t0, T, dt = 1, 0, 1, 0.01
# Solve the SDE using the Milstein method
t, x = milstein_method(f, g, dg, x0, t0, T, dt)
# t holds the array of time points, and x holds the array of solution values at those points
Metadata
Release files for numerical-pde-solver 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| numerical-pde-solver-0.1.4.tar.gz | 3.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| numerical_pde_solver-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / numerical-pde-solver-0.1.4.tar.gz
| Download URL | numerical-pde-solver-0.1.4.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9422100df090aefc1a6b8f5cc9a33a7642a933005be67960ac5e8cabd6cb4075
|
|
BLAKE2b-256 checksum How to use checksums |
ecae2fb730b957e8fc0a81c2c438158151109d4117814396168ff613c192cc54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.7
|
Release files / numerical_pde_solver-0.1.4-py3-none-any.whl
| Download URL | numerical_pde_solver-0.1.4-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52df0c97ee05a83d2a9b5dccd54cdec91d6e084bf4eb07ed2df1d119d3a4eea4
|
|
BLAKE2b-256 checksum How to use checksums |
1e7ffe3f6dd8b66cb8d8132a1c6e81730a6053f270843a3d00eb4584a4196e5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.7
|
Security for numerical-pde-solver 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.