pykinsol provides a Python binding to the Nonlinear system of equation solver algorithms from kinsol in the SUNDIALS suite. pykinsol allows a user to numerically solve (systems of) non-linear equations. Note that not all functionality of KINSOL are currently exposed in the python wrapper. Additional functionality is however easy to add if needed.
You may also want to know that you can use pykinsol from pyneqsys which can e.g. derive the Jacobian analytically for you.
Documentation
Autogenerated API documentation is found here.
Installation
Simplest way to install pykinsol is to use the conda package manager:
$ conda install -c bjodah pykinsol pytest $ python -m pytest --pyargs pykinsol
tests should pass.
Binary distribution is available here: https://anaconda.org/bjodah/pykinsol
Source distribution is available here: https://pypi.python.org/pypi/pykinsol
To compile from source you may proceed e.g. as follows:
$ LLAPACK=openblas python3.4 setup.py install --user
where we specified specifically what LAPACK implementation we used for building SUNDIALS.
Examples
See examples/, and rendered jupyter notebooks here: http://hera.physchem.kth.se/~pykinsol/branches/master/examples
Here is a simple example:
>>> def f(x, fout):
... fout[0] = x[0] + (x[0] - x[1])**3/2 - 1
... fout[1] = x[1] + (x[1] - x[0])**3/2
...
>>> def j(x, Jout, fx):
... Jout[0, 0] = 1 + 3/2 * (x[0] - x[1])**2
... Jout[0, 1] = -3/2 * (x[0] - x[1])**2
... Jout[1, 0] = -3/2 * (x[1] - x[0])**2
... Jout[1, 1] = 1 + 3/2 * (x[1] - x[0])**2
...
>>> from pykinsol import solve
>>> result = solve(f, j, [0, 0])
>>> assert result['success']
>>> print(result['x']) # doctest: +SKIP
[ 0.84116389 0.15883611]
License
The source code is Open Source and is released under the simplified 2-clause BSD license. See LICENSE for further details.
Contributors are welcome to suggest improvements at https://github.com/bjodah/pykinsol
Metadata
Release files for pykinsol 0.1.9
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 | |
|---|---|---|---|---|
| pykinsol-0.1.9.tar.gz | 114.6 kB | Without provenance | Details |
Release files / pykinsol-0.1.9.tar.gz
| Download URL | pykinsol-0.1.9.tar.gz |
|---|---|
| Size | 114.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08c1f0f258675c8faf541892cb0a2d883671cdfba90e217e84042a13e970c55a
|
|
BLAKE2b-256 checksum How to use checksums |
a8deb9c9f0f04107a08c1b577a9ddb2fbb6d95522fe20128bbc3902d620d5d8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for pykinsol 0.1.9
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.