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", and a prediction error method for state space identification ("PEM_SS") It only depeds on numpy, scipy and optionally matplotlib.
Usage
- 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')
- 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()
- Identify a state space model with order 3 using the "PO-MOESP" algorithm.
mod = llsi.sysid(data,'Nu','Re',(3,),method='po-moesp')
- 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)
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
Built Distribution
File details
Details for the file llsi-0.1.0.tar.gz
.
File metadata
- Download URL: llsi-0.1.0.tar.gz
- Upload date:
- Size: 615.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b482227d51d9325485044708c5a04d9dd6c3a6f6a747756ef24c7e4cd4b1185 |
|
MD5 | 738d99271749e90370a718a1aaca906d |
|
BLAKE2b-256 | da5bec8ba3bcc7828f3fb2f245d153c1fa3699f107ef68ddb9e3e3ab0d24c93b |
File details
Details for the file llsi-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: llsi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2441e05a7385518f3f2895de13f27caa4da90f922bc22dfa4ea2b521d82516ad |
|
MD5 | 88b36a5f9c6243a9cfed6e8fdb8284ea |
|
BLAKE2b-256 | 65a824e9f80b4a71f28fd97f639a3b5ede92d0f973a70ae4567a86ca711a2289 |