【问题标题】:Discrete to continuous time transfer function离散到连续时间传递函数
【发布时间】:2018-05-23 11:01:00
【问题描述】:

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

  • 将离散时间模型转换为连续时间模型,
  • 识别连续时间模型,
  • 调整 LQR 方法以确定离散时域的最佳 PID 参数。

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

【问题讨论】:

    标签: python continuous control-theory system-identification


    【解决方案1】:

    有几个选项可以使用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 ]]))
    

    目前支持zohfohtustinforward eulerbackward euler,包括非离散化。文档位于http://harold.readthedocs.io/en/latest/index.html

    【讨论】:

    • 感谢您的回答。现在,我转向了一个不同的话题,但我肯定会研究harold。非离散化功能听起来很有趣。我认为使用python-controlscipy.signal 是不可能的。
    猜你喜欢
    • 2018-05-02
    • 2014-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-20
    • 1970-01-01
    • 2018-03-21
    • 2022-07-07
    相关资源
    最近更新 更多