首页 > 解决方案 > 离散到连续时间传递函数

问题描述

我实现了一个类来识别 Python 中的 ARX 模型。下一步是基于 LQR 计算最优 PID 参数。显然需要一个连续的时间模型,我有以下可能性:

在 Matlab 中,前两种方法很容易完成,但我在 Python 中需要它们。有人知道Matlab是如何实现d2c的并有参考吗?

标签: pythoncontinuouscontrol-theorysystem-identification

解决方案


有几个选项可以使用python-control包或scipy.signal模块或使用harold(无耻插件:我是作者)。

这是一个例子

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 ]]))

目前支持zoh, foh, tustin, forward euler,backward euler包括非离散化。该文档位于http://harold.readthedocs.io/en/latest/index.html


推荐阅读