DySys
A Python package for system dynamics and control systems utilities (using numpy, sympy, and control)
Installation
This package now published on PyPI and can be installed with
pip install dysys
Usage
To import the package into a script, use
import dysys as ds
Symbolic State-Space Models
Create a symbolic state-space model:
A = [[-4, -3, 0], [0, -8, 4], [0, 0, -1]]
B = [[0], [1], [0]]
C = [[0, 1, 0]]
D = [[0]]
sys = ds.sss(A, B, C, D) # Create a symbolic state-space model
Factoring a Transfer Function
import dysys as ds
import control
import matplotlib.pyplot as plt
Define a transfer function using the dysys package as follows:
H = ds.tf(
[1_000_000, 300_000_000], # Numerator coef's
[1, 1030, 40200, 10_300_000, 100_000_000] # Denominator coef's
)
Get a list of transfer functions that are the canonical factors of H{.py}:
factors = H.factor_canonical(check=True) # Check that the factors are correct
Print the factors:
for factor in factors:
print(factor)
$\frac{3}{1}$
$\frac{0.003333 s + 1}{1}$
$\frac{1 \times 10^{4}}{s^2 + 20 s + 1 \times 10^{4}}$
$\frac{1}{0.1 s + 1}$
$\frac{1}{0.001 s + 1}$
Generate a Bode plot:
control.bode_plot([H] + factors, dB=True, wrap_phase=True)
plt.gcf().legend(
list(map(lambda x: x._repr_latex_()[1:-1], [H] + factors)),
loc="outside center right",
)
plt.show()
Issues
If you have issues, please report them on the issues page.
Metadata
Release files for dysys 0.1.11
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 | |
|---|---|---|---|---|
| dysys-0.1.11.tar.gz | 7.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dysys-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / dysys-0.1.11.tar.gz
| Download URL | dysys-0.1.11.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14ef2d474b10064f05aba46ac7a17d27f12e84a70243093424c78504692b166d
|
|
BLAKE2b-256 checksum How to use checksums |
29243148f27aad9d845c3087f0eb5883fc679f59215c585cfd2c256d5a8a7b35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.12.9 Darwin/25.3.0
|
Release files / dysys-0.1.11-py3-none-any.whl
| Download URL | dysys-0.1.11-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de932cd54d19cf82735e585b78ebf92b002c1ddcb041e706c5b01129602c20a8
|
|
BLAKE2b-256 checksum How to use checksums |
f239dd050e594569994a537d26bab35ab86159ac4d31a32a53ac6aae53a6c344
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.12.9 Darwin/25.3.0
|
Security for dysys 0.1.11
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.