【多变量控制系统 Multivariable Control System】(2)给定系统转换方程,绘制奈奎斯特图【新加坡南洋理工大学】

一、系统转换方程

系统的转换方程 G(s) 和回馈矩阵 K(s) 由下2式给出:

在这里插入图片描述

二、从转换方程推出系统矩阵A和B

from scipy.signal import tf2ss

# Convert to state-space representation
A, B, C, D = tf2ss([1], [1, -2, 1])

print("A matrix:", A)
print("B matrix:", B)
print("C matrix:", C)
print("D matrix:", D)

函数定义(版权:scipy库):

def tf2ss(num, den):
    r"""Transfer function to state-space representation.

    Parameters
    ----------
    num, den : array_like
        Sequences representing the coefficients of the numerator and
        denominator polynomials, in order of descending degree. The
        denominator needs to be at least as long as the numerator.

    Returns
    -------
    A, B, C, D : ndarray
        State space representation of the system, in controller canonical
        form.

    Examples
    --------
    Convert the transfer function:

    .. math:: H(s) = \frac{s^2 + 3s + 3}{s^2 + 2s + 1}

    >>> num = [1, 3, 3]
    >>> den = [1, 2, 1]

    to the state-space representation:

    .. math::

        \dot{\textbf{x}}(t) =
        \begin{bmatrix} -2 & -1 \\ 1 & 0 \end{bmatrix} \textbf{x}(t) +
        \begin{bmatrix} 1 \\ 0 \end{bmatrix} \textbf{u}(t) \\

        \textbf{y}(t) = \begin{bmatrix} 1 & 2 \end{bmatrix} \textbf{x}(t) +
        \begin{bmatrix} 1 \end{bmatrix} \textbf{u}(t)

    >>> from scipy.signal import tf2ss
    >>> A, B, C, D = tf2ss(num, den)
    >>> A
    array([[-2., -1.],
           [ 1.,  0.]])
    >>> B
    array([[ 1.],
           [ 0.]])
    >>> C
    array([[ 1.,  2.]])
    >>> D
    array([[ 1.]])
    """

程序输出:

A matrix: [[ 2. -1.]
 [ 1.  0.]]
B matrix: [[1.]
 [0.]]
C matrix: [[0. 1.]]
D matrix: [[0.]]

三、奈奎斯特图的绘制(使用MATLAB)

开环系统: 需要矩阵A, B, C, D

A = [2 -1; 1 0];
B = [1; 0];
C = [0 1];
D = 0;
s = tf('s');
ltf = ss(A, B, C, D);
figure;
nyquist(ltf);
grid on;

奈奎斯特图像:

在这里插入图片描述

闭环系统: 需要矩阵A, B, K

% Define the system matrices A and B
A = [2, -1; 1, 0];
B = [1; 0];

% Define the closed-loop gain function K(s)
numerator = [1500, -100];
denominator = [1, 30, 400];
K = tf(numerator, denominator);

% Create the closed-loop system
sys_cl = ss(A, B, eye(2), 0); % Assuming direct feedback

% Plot the Nyquist diagram
nyquist(sys_cl * K);
grid on;

奈奎斯特图像(主要关注通道2):

在这里插入图片描述

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不是AI

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值