简体   繁体   English

离散连续时间传递功能

[英]Discrete to continuous time transfer function

I implemented a class to identify ARX models in Python. 我实现了一个类来识别Python中的ARX模型。 The next step is the calculation of optimal PID parameters based on LQR. 下一步是基于LQR的最佳PID参数的计算。 Apparently a continuous time model is required and I have the following possibilites: 显然,需要一个连续的时间模型,并且我具有以下可能性:

  • transform the discrete time model to a continuous time model, 将离散时间模型转换为连续时间模型,
  • identify a continuous time model, 确定一个连续的时间模型
  • adapt the LQR approach to determine optimal PID parameters to the discrete time domain. 调整LQR方法以确定离散时域的最佳PID参数。

In Matlab the first two approaches are easily done, but I need them in Python. 在Matlab中,前两种方法很容易实现,但是我在Python中需要它们。 Does anybody know how Matlab implemented d2c and has a reference? 有人知道Matlab如何实现d2c并具有参考吗?

There are a few options you can use python-control package or scipy.signal module or use harold (shameless plug: I'm the author). 您可以使用python-control软件包或scipy.signal模块或使用harold (无耻的插件:我是作者),有几个选项。

Here is an example 这是一个例子

import harold

G = harold.Transfer(1, [1, 2, 1])

H_zoh = harold.discretize(G, dt=0.1, method='zoh')

H_tus = harold.discretize(G, dt=0.1, method='tustin')

H_zoh.polynomials
Out[5]: 
(array([[0.00467884, 0.00437708]]),
 array([[ 1.        , -1.80967484,  0.81873075]]))

H_tus.polynomials
Out[6]: 
(array([[0.00226757, 0.00453515, 0.00226757]]),
 array([[ 1.        , -1.80952381,  0.8185941 ]]))

Currently zoh , foh , tustin , forward euler , backward euler is supported including undiscretizations. 目前zohfohtustinforward eulerbackward euler支持包括undiscretizations。 The documentation is found at http://harold.readthedocs.io/en/latest/index.html 该文档位于http://harold.readthedocs.io/en/latest/index.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 matplotlib离散数据与连续函数 - matplotlib discrete data versus continuous function Python中连续而不是离散的强度梯度描述函数 - Continuous rather than discrete intensity gradient describing function in python 使用 OpenTURNS 的连续和离散变量 - Continuous and discrete variables with OpenTURNS 使用 scipy.signal.dstep 绘制离散传输 function - Plotting a discrete transfer function using scipy.signal.dstep 实时更新连续功能 - Update continuous function in real time 如何在 python 中运行连续工作人员 - 实时数据传输? - How to run continuous workers in python - Real time data transfer? 稀疏数据上的离散和连续分类器 - Discrete and Continuous Classifier on Sparse Data python-具有离散和连续的多元回归 - python - multivariate regression with discrete and continuous 如何在python中绘制一个显示离散步骤而不是连续变化的函数? - How to plot a function showing discrete steps rather than continuous changes between samples in python? 如何使用连续时间数字索引对 Pandas dataframe 中的数据重新采样,聚合值到离散 integer 时间? - How do I resample data, aggregating values, in Pandas dataframe with a continuous-time numeric index to discrete integer time?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM