简体   繁体   English

八度控制软件包tf

[英]octave control package tf

Using the octave/matlab control toolbox: 使用八度/ matlab控制工具箱:

octave.exe:1> pkg load control

I define the same transfer function in two different ways: 我用两种不同的方式定义相同的传递函数:

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.

And then evaluate it at s = j : 然后在s = j处求值:

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

Why are these different!? 为什么这些不同!?

I think the way you define a is incorrect. 我认为您定义a方式不正确。 I am not sure why it doesn't error out when you run the command, but it's not how you should define a transfer function. 我不确定为什么在运行命令时它不会出错,但这不是定义传递函数的方式。 if we consider the following: 如果我们考虑以下因素:

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

You'll notice how c in my example ( a in yours) is not displayed the same as all the other transfer function, it's all on one line. 您会注意到在我的示例(您的示例中的ac显示方式与其他所有传递函数都不相同,而是全部显示在一行上。 Maybe it's treating the input 1/(s+1) as a string? 也许将输入1/(s+1)当作一个字符串? I really don't know. 我真的不知道

Anyway, the point is that all 3 other ways of defining the transfer function are correct and equivalent, and all give the same and correct result. 无论如何,关键是定义传递函数的所有其他三种方式都是正确和等效的,并且都给出相同且正确的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM