【问题标题】:octave control package tf倍频程控制包 tf
【发布时间】:2014-11-12 00:46:35
【问题描述】:

使用octave/matlab控制工具箱:

octave.exe:1> pkg load control

我用两种不同的方式定义相同的传递函数:

octave.exe:2> a = tf('1/(s + 1)')

Transfer function 'a' from input 'u1' to output ...

 y1:  1/(s + 1)

Continuous-time model.
octave.exe:3> b = 1 / (tf('s') + 1)

Transfer function 'b' from input 'u1' to output ...

        1
 y1:  -----
      s + 1

Continuous-time model.

然后在s = j进行评估:

octave.exe:4> a(1)
ans =  0 + 1i
octave.exe:5> b(1)
ans =  0.50000 - 0.50000i

为什么这些不同!?

【问题讨论】:

    标签: matlab octave


    【解决方案1】:

    我认为您定义a 的方式不正确。我不确定为什么在运行命令时它不会出错,但这不是你应该如何定义传递函数的方式。如果我们考虑以下几点:

    >> a = tf(1,[1 1])
    
    Transfer function 'a' from input 'u1' to output ...
    
            1
     y1:  -----
          s + 1
    
    Continuous-time model.
    >> a(1)
    ans =  0.50000 - 0.50000i
    >> b = 1/(tf('s')+1)
    
    Transfer function 'b' from input 'u1' to output ...
    
            1
     y1:  -----
          s + 1
    
    Continuous-time model.
    >> b(1)
    ans =  0.50000 - 0.50000i
    >> c = tf('1/(s+1)')
    
    Transfer function 'c' from input 'u1' to output ...
    
     y1:  1/(s+1)
    
    Continuous-time model.
    >> c(1)
    ans =  0 + 1i
    >> s = tf('s')
    
    Transfer function 's' from input 'u1' to output ...
    
     y1:  s
    
    Continuous-time model.
    >> d = 1/(s+1)
    
    Transfer function 'd' from input 'u1' to output ...
    
            1
     y1:  -----
          s + 1
    
    Continuous-time model.
    >> d(1)
    ans =  0.50000 - 0.50000i
    

    您会注意到我的示例中的c(您的示例中的a)与所有其他传递函数的显示方式不同,它们都在一条线上。也许它将输入1/(s+1) 视为字符串?我真的不知道。

    无论如何,关键是所有其他 3 种定义传递函数的方法都是正确且等效的,并且都给出了相同且正确的结果。

    【讨论】:

    • 你用的是matlab还是octave?因此,这可能应该升级为错误报告
    • 我使用的是 Octave 3.8。将创建一个错误报告。
    猜你喜欢
    • 2015-05-28
    • 1970-01-01
    • 1970-01-01
    • 2013-09-22
    • 1970-01-01
    • 1970-01-01
    • 2013-11-09
    • 1970-01-01
    • 2017-11-12
    相关资源
    最近更新 更多