matlab - octave control package tf -
using octave/matlab control toolbox:
octave.exe:1> pkg load control
i define same transfer function in 2 different ways:
octave.exe:2> = tf('1/(s + 1)') transfer function 'a' input 'u1' output ... y1: 1/(s + 1) continuous-time model. octave.exe:3> b = 1 / (tf('s') + 1) transfer function 'b' input 'u1' output ... 1 y1: ----- s + 1 continuous-time model.
and evaluate @ s = j
:
octave.exe:4> a(1) ans = 0 + 1i octave.exe:5> b(1) ans = 0.50000 - 0.50000i
why these different!?
i think way define a
incorrect. not sure why doesn't error out when run command, it's not how should define transfer function. if consider following:
>> = tf(1,[1 1]) transfer function 'a' input 'u1' output ... 1 y1: ----- s + 1 continuous-time model. >> a(1) ans = 0.50000 - 0.50000i >> b = 1/(tf('s')+1) transfer function 'b' input 'u1' output ... 1 y1: ----- s + 1 continuous-time model. >> b(1) ans = 0.50000 - 0.50000i >> c = tf('1/(s+1)') transfer function 'c' input 'u1' output ... y1: 1/(s+1) continuous-time model. >> c(1) ans = 0 + 1i >> s = tf('s') transfer function 's' input 'u1' output ... y1: s continuous-time model. >> d = 1/(s+1) transfer function 'd' input 'u1' output ... 1 y1: ----- s + 1 continuous-time model. >> d(1) ans = 0.50000 - 0.50000i
you'll notice how c
in example (a
in yours) not displayed same other transfer function, it's on 1 line. maybe it's treating input 1/(s+1)
string? don't know.
anyway, point 3 other ways of defining transfer function correct , equivalent, , give same , correct result.
Comments
Post a Comment