Message Boards Message Boards

5 Replies
2 Total Likes
View groups...
Share this post:

What is the correct syntax for TransferFunctionModel?

Posted 10 years ago

One of the forms for TransferFunctionModel is:

TransferFunctionModel[{z, p, g}, s]

Where z, p, g are the zeroes, poles, and gain.

There is no detail or example on this syntax that I can find. So I assume z and p are each lists of the numerical values, and g is a single constant. I try this in the code below, which describes a zero at -5000, and poles at -100 and -1000. This works fine if I just use the s domain expression, but returns unevaluated for my assumed {z,p,g} syntax.

tfm1 = TransferFunctionModel[{{20 (s + 5000)/((s + 100) (s + 1000))}},

BodePlot[tfm1, {1, 100000}] (* this plots correctly *)

(* this is the {zeros, poles, gain} where zroes and poles is each a \
list of the values *)
(*it returns unevaluated *)
tfm2 = TransferFunctionModel[{{-5000}, {-100, -1000}, 1}, s]

Does anyone know how to do this correctly? Or where more documentation can be found?

Best, David

POSTED BY: David Keith
5 Replies
Posted 8 years ago

If you look under the documentation under the "Scope" drop down, there is an example that shows the correct syntax for the {z, p, g} syntax. The documentation under "Details and Options" should probably include this (as it does for {num, den} syntax).


Instead of dealing with all those {{{...}}}, I like to just use the standard gain * num(s)/den(s) for everything. Like this:

gain = 5;
zeros = {-1, -2};
poles = {0, -4, -6};
num = Times @@ ((s - #) & /@ zeros);
den = Times @@ ((s - #) & /@ poles);

Now use standard gain * G(s) synatx

 tf = TransferFunctionModel[gain (num/den), s]

The above is simpler for me than writing

 tf = TransferFunctionModel[{{{{-1, -2}}}, {{{0, -4, -6}}}, {{gain}}}, s]

And having to count braces to make sure they match.

POSTED BY: Nasser M. Abbasi
Posted 8 years ago

This exact issue came up for me today; I even tried a variety of list nesting levels, and couldn't get it to work. Thanks! --Todd

POSTED BY: Todd Moyer
Posted 10 years ago

Thanks, Fabian. I was not using lists there were sufficiently deep in nesting.

Best, David

POSTED BY: David Keith
tf1 = TransferFunctionModel[(5 (1 + s))/(10 + s), s] 
tf2 = TransferFunctionModel[{{{5 (1 + s)}}, {{10 + s}}}, s] 
tf3 = TransferFunctionModel[{{{{-1}}}, {{{-10}}}, {{5}}}, s]

  OutputResponse[#, UnitStep[t - 1], {t, 0, 10}] & /@ {tf1, tf2, tf3}], 
  {t, 0, 10}, PlotRange -> All]

enter image description here

See tf3 for the correct syntax. (tf2 is with numerator and denominator)

POSTED BY: Fabian Wiek
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract