3
$\begingroup$

I am wondering if there is any keyboard shortcut to type transfer function model symbol as in the picture below.

I would like to plot root locus of that function but I can't figure out how to type the transfer function model symbol.

enter image description here

$\endgroup$
  • 2
    $\begingroup$ Like almost everything in Mathematica, this is a function. It's name is TransferFunctionModel and is used as TransferFunctionModel[{{{k (1 + s)}}, ((-1 + s) s) (16 + 4 s + s^2)}, s] $\endgroup$ – bill s Dec 4 '16 at 15:57
  • $\begingroup$ @bill I have the feeling the OP wants to know how you get this fancy input with that scripted capital T there. The examples given in the documentation suggest that you could do something like that. Transpose can be written similarly fancy by entering esc-tr-esc after a matrix, so the suggestion might be that a similar trick is possible for a transfer function or a statespace matrix. $\endgroup$ – Sjoerd C. de Vries Dec 4 '16 at 18:46
  • $\begingroup$ @Sjoerd C. de Vries, yes that is what I want. However, from the answer I there is no such a thing to do it now. $\endgroup$ – anhnha Dec 4 '16 at 22:13
3
$\begingroup$

Like almost everything in Mathematica, this is a function. It's name is TransferFunctionModel and is used as

TransferFunctionModel[{{{k (1 + s)}}, ((-1 + s) s) (16 + 4 s + s^2)}, s]

If you find yourself using it a lot, one thing you can do it to define your own "shortcut".

tf[f_, s_] := TransferFunctionModel[f, s];

Now you can use the tf shortcut at will:

tf[{{{k (1 + s)}}, ((-1 + s) s) (16 + 4 s + s^2)}, s] 

The prefix syntax also works:

tf @@ {{{{k (1 + s)}}, ((-1 + s) s) (16 + 4 s + s^2)}, s}

as does the infix syntax:

{{{k (1 + s)}}, ((-1 + s) s) (16 + 4 s + s^2)}~tf~s
$\endgroup$
  • $\begingroup$ Thanks for the shortcuts. How can you write the fraction like that? $\endgroup$ – anhnha Dec 4 '16 at 16:27
  • $\begingroup$ I'm not sure I know what you mean. If you evaluate any of the above, it appears in the notebook just as in your image. $\endgroup$ – bill s Dec 4 '16 at 16:34
  • $\begingroup$ I mean this fraction {{{k (1 + s)}}, ((-1 + s) s) (16 + 4 s + s^2)}. Is there a guideline about how it work? $\endgroup$ – anhnha Dec 4 '16 at 16:35
  • 1
    $\begingroup$ It's in the form of a list: {{numerator polynomial}, denominator polynomial}. Look at the help file for TransferFunctionModel for a bunch of examples. If you want alternative ways to enter the fraction, check out the "Basic Math Assistant" under the Palettes menu. $\endgroup$ – bill s Dec 4 '16 at 16:40
  • $\begingroup$ Thanks. I just confused about the fraction as a list. $\endgroup$ – anhnha Dec 4 '16 at 16:41
3
$\begingroup$

You can use evaluate in place (keyboard short cut on OSX is Cmd+Enter). Here is a short animation:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.