[英]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: 显然,需要一个连续的时间模型,并且我具有以下可能性:
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. 目前zoh
, foh
, tustin
, forward euler
, backward 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.