ddeint
Scipy-based delay differential equation (DDE) solver. See the docstrings and examples for more infos.
Examples
from pylab import cos, linspace, subplots
from ddeint import ddeint
# We solve the following system:
# Y(t) = 1 for t < 0
# dY/dt = -Y(t - 3cos(t)**2) for t > 0
def values_before_zero(t):
return 1
def model(Y, t):
return -Y(t - 3 * cos(Y(t)) ** 2)
tt = linspace(0, 30, 2000)
yy = ddeint(model, values_before_zero, tt)
fig, ax = subplots(1, figsize=(4, 4))
ax.plot(tt, yy)
ax.figure.savefig("variable_delay.jpeg")
from pylab import array, linspace, subplots
from ddeint import ddeint
# We solve the following system:
# X(t) = 1 (t < 0)
# Y(t) = 2 (t < 0)
# dX/dt = X * (1 - Y(t-d)) / 2
# dY/dt = -Y * (1 - X(t-d)) / 2
def model(Y, t, d):
x, y = Y(t)
xd, yd = Y(t - d)
return array([0.5 * x * (1 - yd), -0.5 * y * (1 - xd)])
g = lambda t: array([1, 2])
tt = linspace(2, 30, 20000)
fig, ax = subplots(1, figsize=(4, 4))
for d in [0, 0.2]:
print("Computing for d=%.02f" % d)
yy = ddeint(model, g, tt, fargs=(d,))
# WE PLOT X AGAINST Y
ax.plot(yy[:, 0], yy[:, 1], lw=2, label="delay = %.01f" % d)
ax.figure.savefig("lotka.jpeg")
Licence
Public domain. Everyone is welcome to contribute !
Installation
ddeint can be installed by unzipping the source code in one directory and using this command: ::
(sudo) python setup.py install
You can also install it directly from the Python Package Index with this command: ::
(sudo) pip install ddeint
Metadata
Release files for ddeint 0.3.0
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 | Actions |
|---|---|---|---|---|
| ddeint-0.3.0.tar.gz | 6.9 kB | Without provenance | Details for ddeint-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ddeint-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for ddeint-0.3.0-py3-none-any.whl |
Total release size: 13.7 kB
Release files / ddeint-0.3.0.tar.gz
| Download URL | ddeint-0.3.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51dd96545e06750037b25329880896d9408940a67a6228d0a07a82c38e33710f
|
|
BLAKE2b-256 checksum How to use checksums |
ce06094f64e440a9d9f14ebf9d1c3fdd9637b2bbc0709fe3cc2196bcd6f78ad9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.5
|
Release files / ddeint-0.3.0-py3-none-any.whl
| Download URL | ddeint-0.3.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44c5cbb447069539ae5d03b245738724da6575bb0388d99261dabc0f8e162841
|
|
BLAKE2b-256 checksum How to use checksums |
1def6303681fdc6cf3b72d0b158ea9b18480a1ebc3fab16605a243112725fa68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.5
|
Security for ddeint 0.3.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.