Skip to main content

A lightweight linear system identification tool

Project description

llsi

Lightweight Linear System Identification package.

llsi offers easy acess to system identification algorithms. Currently implemented are n4sid, PO-MOESP for state space identification, and arx for the identification of transfer function models. Additionally, a prediction error method (pem) exists for the identification of output-error (oe) models or iterative improvement of state-space models. llsi only depeds on numpy, scipy and matplotlib.

To try them out online, you can use Binder.

Code style: black Imports: isort

Usage

Identification

  1. Load data start with loading the heated wire dataset (found in the data/ folder at the root of this repo) using numpy
import numpy as np
d = np.load('heated_wire_data.npy')
  1. Create a SysIdData object
import llsi
data = llsi.SysIdData(t=d[:,0],Re=d[:,1],Nu=d[:,2])

the three data series are time (t), Reynolds number (Re) and Nußelt number (Nu). We are going to model the dynamics of the Nußelt number (heat transfer from wire to surrounding fluid) using Reynolds number (velocity of the surrounding fluid) as input. 3. Ensure the time steps are equidistant and the sampling rate is reasonable. Moreover, the beginning of the time series (transient start) is removed and finally the series are centerd around their respective mean value (which is a requirement for linear systems).

data.equidistant()
data.downsample(3)
data.crop(start=100)
data.center()
  1. Identify a state space model with order 3 using the "PO-MOESP" algorithm.
mod = llsi.sysid(data,'Nu','Re',(3,),method='po-moesp')
  1. Use it further with scipy by exporting it to a scipy.signal.StateSpace object
ss = mod.to_ss()

or to a continuous time transfer function

ss = mod.to_tf(continuous=True)

Plotting

Optionally, if matplotlib is installed, simple plots can be created using the llsi.Figure context manager:

with llsi.Figure() as fig:
    fig.plot(ss,'impulse')

will plot the impulse response of the model ss.

Contribution

Thank you for considering to contribute. Any exchange and help is welcome. However, I have to ask you to be patient with me responding.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llsi-0.5.0.tar.gz (7.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llsi-0.5.0-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file llsi-0.5.0.tar.gz.

File metadata

  • Download URL: llsi-0.5.0.tar.gz
  • Upload date:
  • Size: 7.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llsi-0.5.0.tar.gz
Algorithm Hash digest
SHA256 728504143540bffe72545dc49d29ea251e43bd8caa15ada7fc68769b6b82c2bc
MD5 f9703960733140b44fbf47590a0af709
BLAKE2b-256 dd4ea8ba9168acc6d3fdedc3f8b1ebf73f79d69ac1ab8b3bf0b7ec78e36271bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for llsi-0.5.0.tar.gz:

Publisher: python-publish.yml on arminwitte/llsi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llsi-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: llsi-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llsi-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7021eed5282a1f08e77d823c28074f1c03ba8eccfb6c851c51bb0d1ab58f9f8
MD5 e0ef5cec886494db053624e7903fb6f2
BLAKE2b-256 0e8ad68f586efda96588f4269f138f2db9de2ad9149cb877cf8283b9f4daed71

See more details on using hashes here.

Provenance

The following attestation bundles were made for llsi-0.5.0-py3-none-any.whl:

Publisher: python-publish.yml on arminwitte/llsi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page