Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

scikit-SUNDAE

ci-tests   license   coverage
conda   conda-downloads
pypi   pypi-downloads

Summary

scikit-SUNDAE provides Python bindings to SUNDIALS integrators. The implicit differential algebraic (IDA) solver and C-based variable-coefficient ordinary differential equations (CVODE) solver are both included.

The name SUNDAE combines (SUN)DIALS and DAE, which stands for differential algebraic equations. Solvers specific to DAE problems are not frequently available in Python. An ordinary differential equation (ODE) solver is also included for completeness. ODEs can be categorized as a subset of DAEs (i.e., DAEs with no algebraic constraints).

Installation

scikit-SUNDAE is installable via either pip or conda. To install from PyPI use the following command.

pip install scikit-sundae

If you prefer using the conda package manager, you can install scikit-SUNDAE from the conda-forge channel using the command below.

conda install -c conda-forge scikit-sundae

Both sources contain binary installations. If your combination of operating system and CPU architecture is not supported, please submit an issue to let us know. If you'd prefer to build from source, please see the documentation.

Get Started

You are now ready to start solving. Run one of the following examples to check your installation. Afterward, check out the documentation for a full list of options (including event functions), detailed examples, and more.

# Use the CVODE integrator to solve the Van der Pol equation
import matplotlib.pyplot as plt

from sksundae.cvode import CVODE


def rhsfn(t, y, yp):
    yp[0] = y[1]
    yp[1] = 1000*(1 - y[0]**2)*y[1] - y[0]


solver = CVODE(rhsfn)
soln = solver.solve([0, 3000], [2, 0])

plt.plot(soln.t, soln.y[:, 0])
plt.show()

The CVODE solver demonstrated above is only capable of solving pure ODEs. The constant parameters and time span used above match an example given by MATLAB for easy comparison. If you are trying to solve a DAE, you will want to use the IDA solver instead. A minimal DAE example is given below for the Robertson problem. As with the CVODE example, the parameters and options below are chosen to match an online MATLAB example for easy comparison.

# Use the IDA integrator to solve the Robertson problem
import numpy as np
import matplotlib.pyplot as plt

from sksundae.ida import IDA


def resfn(t, y, yp, res):
    res[0] = yp[0] + 0.04*y[0] - 1e4*y[1]*y[2]
    res[1] = yp[1] - 0.04*y[0] + 1e4*y[1]*y[2] + 3e7*y[1]**2
    res[2] = y[0] + y[1] + y[2] - 1


solver = IDA(
    resfn,
    algebraic_idx=[2],
    calc_initcond='yp0',
    rtol=1e-4,
    atol=[1e-6, 1e-10, 1e-6],
)

tspan = np.hstack([0.0, 4.0 * np.logspace(-6, 6)])
soln = solver.solve(tspan, [1, 0, 0], [0, 0, 0])

soln.y[:, 1] *= 1e4  # scale y1 so it is visible in the figure

plt.semilogx(soln.t, soln.y)
plt.legend(['y0', 'y1', 'y2'])
plt.show()

Notes:

  • If you are new to Python, check out Spyder IDE. Spyder is a powerful interactive development environment (IDE) that can make programming in Python more approachable to new users.
  • Check the solve_ivp documentation from scipy or the solve-dae package repository if you are looking for common examples to test out and compare against. Translating an example from another package can help you learn how to use scikit-SUNDAE before trying to solve more challenging problems.

Citing this Work

This work was authored by researchers at the National Laboratory of the Rockies (NLR). If you use use this package in your work, please include the following citation:

Randall, Corey R. "scikit-SUNDAE: Python bindings to SUNDIALS Differential Algebraic Equation solvers [SWR-24-137]." Computer software, Oct. 2024. url: github.com/NatLabRockies/scikit-sundae. doi: 10.11578/dc.20241104.3.

For convenience, we also provide the following for your BibTex:

@misc{randall2024sksundae,
  author = {Randall, Corey R.},
  title = {{scikit-SUNDAE: Python bindings to SUNDIALS Differential Algebraic Equation solvers [SWR-24-137]}},
  url = {github.com/NatLabRockies/scikit-sundae},
  month = {Oct.},
  year = {2024},
  doi = {10.11578/dc.20241104.3},
}

You should also cite SUNDIALS following their recommendations here. Lastly, if you use the sparse linear solver, please cite the SuperLU_MT library using their reference guide.

Acknowledgements

scikit-SUNDAE was originally inspired by scikits-odes which also offers Python bindings to SUNDIALS. The API for scikit-SUNDAE was mostly adopted from scikits-odes; however, all of our source code is original. If you are comparing the two:

  1. scikits-odes: includes solvers from daepack, scipy, and SUNDIALS. The package only provides source distributions, so users must configure and compile SUNDIALS on their own; however, this gives users maximum flexibility to compile against SUNDIALS builds with their choice of precision, optional solvers, etc.
  2. scikit-SUNDAE: only includes SUNDIALS solvers. Provides sparse solvers, more flexible events function capabilities (e.g., direction detection and terminal flags), and scipy-like output not available in scikits-odes. Both binary and source distributions are available; however, we prioritize compatibility with SUNDIALS releases on conda-forge over general user-compiled builds.

Our binary distributions include pre-compiled dynamic SUNDIALS libraries that also reference libraries like SuperLU_MT, OpenBLAS, and LAPACK. These are self-contained and will not affect other, existing installations you may already have. To be in compliance with each library's distribution requirements, all scikit-SUNDAE distributions include a summary of all licenses (see the LICENSES_bundled file). Note that we only link against and distribute packages with a BSD-3 license. Some solvers and options, like KLU, have LGPL licenses and are therefore not compatible to implement nor distribute.

Contributing

If you'd like to contribute to this package, please look through the existing issues. If the bug you've caught or the feature you'd like to add isn't already reported, please submit a new issue. You should also read through the developer guidelines if you plan to work on the issue yourself.

Disclaimer

This work was authored by the National Laboratory of the Rockies (NLR), operated by Alliance for Energy Innovation, LLC, for the U.S. Department of Energy (DOE). The views expressed in the repository do not necessarily represent the views of the DOE or the U.S. Government.

Metadata

Release files for scikit-sundae 1.2.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scikit-sundae 1.2.0rc1
File Size Uploaded Provenance Actions
scikit_sundae-1.2.0rc1.tar.gz 63.2 kB Without provenance Details for scikit_sundae-1.2.0rc1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for scikit-sundae 1.2.0rc1
File Actions
scikit_sundae-1.2.0rc1-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for scikit_sundae-1.2.0rc1-cp315-cp315-win_amd64.whl
scikit_sundae-1.2.0rc1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for scikit_sundae-1.2.0rc1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
scikit_sundae-1.2.0rc1-cp315-cp315-macosx_11_0_x86_64.whl CPython 3.15 CPython 3.15 macOS 11.0+ x86-64 Details for scikit_sundae-1.2.0rc1-cp315-cp315-macosx_11_0_x86_64.whl
scikit_sundae-1.2.0rc1-cp315-cp315-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 macOS 11.0+ ARM64 Details for scikit_sundae-1.2.0rc1-cp315-cp315-macosx_11_0_arm64.whl
scikit_sundae-1.2.0rc1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for scikit_sundae-1.2.0rc1-cp311-cp311-win_amd64.whl
scikit_sundae-1.2.0rc1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for scikit_sundae-1.2.0rc1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
scikit_sundae-1.2.0rc1-cp311-cp311-macosx_11_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 11.0+ x86-64 Details for scikit_sundae-1.2.0rc1-cp311-cp311-macosx_11_0_x86_64.whl
scikit_sundae-1.2.0rc1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for scikit_sundae-1.2.0rc1-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 107.1 MB

Release files / scikit_sundae-1.2.0rc1.tar.gz

Download URL scikit_sundae-1.2.0rc1.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f463f71fa1e780a6ff89046d08a5211b3cc7b39c6f4e803121437ae7a079f79d
BLAKE2b-256 checksum
How to use checksums
833dbae0e0546c27a4a6b7e03d9b8461c7f2dc651a02f624a0b56e9fbff8e8ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / scikit_sundae-1.2.0rc1-cp315-cp315-win_amd64.whl

Download URL scikit_sundae-1.2.0rc1-cp315-cp315-win_amd64.whl
Size 8.6 MB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
2b49e1f43b1146d6ff8dd97bbecfdcc06a8d1c7f811feedd1fb3bec6df8773bb
BLAKE2b-256 checksum
How to use checksums
cbea8b05daed1a40db4918d552e40c533433c0286a318a66236685b17313ccd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / scikit_sundae-1.2.0rc1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL scikit_sundae-1.2.0rc1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 20.8 MB
Tags CPython 3.15 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9c06b85233a15771e694b412544637a78975e2bc91975df899493d3f0656c34b
BLAKE2b-256 checksum
How to use checksums
4971e06682526f8fada339b6944fd3cd1778b73ebbe573b1e97754d59f819f61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / scikit_sundae-1.2.0rc1-cp315-cp315-macosx_11_0_x86_64.whl

Download URL scikit_sundae-1.2.0rc1-cp315-cp315-macosx_11_0_x86_64.whl
Size 15.5 MB
Tags CPython 3.15 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
00c5d9f9b2ac29b336cce73ab05bf575e42ae93402f58b44d174541bbc984c92
BLAKE2b-256 checksum
How to use checksums
da461f5adaca5b3a00228d1a5563618486afd265a2ebcdfe263b39fd0c418197
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / scikit_sundae-1.2.0rc1-cp315-cp315-macosx_11_0_arm64.whl

Download URL scikit_sundae-1.2.0rc1-cp315-cp315-macosx_11_0_arm64.whl
Size 8.6 MB
Tags CPython 3.15 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
efff79cfc2ebd2a27eafc9d0a4aba410404a2e9bc056d0b1a6698a3b60b68558
BLAKE2b-256 checksum
How to use checksums
1ecd56b9755fe3f0ce40e95dfb198db24ba86d4850f93cc243c26bd040a6686d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / scikit_sundae-1.2.0rc1-cp311-cp311-win_amd64.whl

Download URL scikit_sundae-1.2.0rc1-cp311-cp311-win_amd64.whl
Size 8.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b5ebe3431e7fd14c3f061cb6cd5ac1e866656420585b1bfa58864acc5b259335
BLAKE2b-256 checksum
How to use checksums
cfa48e6c185674e9193e399219cab2de9dc79a2033bd014b487f803116c3c6b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / scikit_sundae-1.2.0rc1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL scikit_sundae-1.2.0rc1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 20.8 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
46eca3544bd5c44293c36aadf08a0b77627c68768a3cb8de680e156e1be8eec1
BLAKE2b-256 checksum
How to use checksums
5ad798985de0062a69877cb6600759014d920341d6b28e3abab2fa9064391e30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / scikit_sundae-1.2.0rc1-cp311-cp311-macosx_11_0_x86_64.whl

Download URL scikit_sundae-1.2.0rc1-cp311-cp311-macosx_11_0_x86_64.whl
Size 15.6 MB
Tags CPython 3.11 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
c76139b30687e8783e4e3c5f3c5e122ca7a368b643100726e6dc732eb56752e4
BLAKE2b-256 checksum
How to use checksums
22803f0065fec71a872ad6f72777537b8c148e56f6b1982603cd60148a279089
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / scikit_sundae-1.2.0rc1-cp311-cp311-macosx_11_0_arm64.whl

Download URL scikit_sundae-1.2.0rc1-cp311-cp311-macosx_11_0_arm64.whl
Size 8.6 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bc7e9de100bc377509c0bb85d193193f8465278a9d830c4cd56f91f84838df7c
BLAKE2b-256 checksum
How to use checksums
b61d7d334a805d791b96391f1180f63d7238dbb59b879afa56c3777b6749e510
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for scikit-sundae 1.2.0rc1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page