Group Abstract Group Abstract

Message Boards Message Boards

Use OutputResponse in WM 12?

Posted 7 years ago

Hello I am trying to simulate a third order system using OutputResponse. Here are the commands I used for the simulation

OutputResponse[TransferFunctionModel[k 1/(s (s + 1)^2 + k), s], 
  UnitStep[t], t]
Plot[% /. {k -> 1}, {t, 0, 100}]

Almost a copy of the example shown in the help page for OutputResponse.
Problems I have encountered are: a) WM takes a long time to output the answer. To be honest, I don't remember being that slow when using the same example in WM 11 (Unfortunately I have deleted the old version to give room to the new one). b) Rather intricate output - Again I don't recall WM 11 using RootSum in this particular problem. It is a third order polynomial. c) For k=1, the system is stable and the output of Plot is a response of an unstable system. It seems right up to t=20 but after WM 12 loses it completely. Numerical problems?

My plan was to encapsulate the commands above in a manipulate loop for different values of k, but unfortunately I don't see how. I have tried different values of k and the output was not the one expected for any of them.

Any help will be much appreciated.

Ed

Ps. I have tried alternatives such as defining a function resp[t,k] with = and := but to no avail.

POSTED BY: Eduardo Mendes
3 Replies
Posted 7 years ago

Hi David

Many thanks for the examples. Thanks to one of them, I wrote an animation that works in this case.

Manipulate[
 tfm = TransferFunctionModel[k 1/(s (s + 1)^2 + k), s];
 out = OutputResponse[tfm /. k -> kval, UnitStep[t], {t, 0, 50}];
 Plot[out, {t, 0, 50}, PlotRange -> All],
 {{kval, 1, "Gain"}, 0, 100, 1, Appearance -> "Labeled"}]

I have been reporting Control Toolbox bugs since the time one had to buy it separately (Control System Professional version 2.1). I think this issue will be another one on my list.

Kind Regards

Ed

POSTED BY: Eduardo Mendes

If you use {k->1.}, Chop function is usually advised to applied to eliminate complex epsilons during numeric operation.

POSTED BY: Shenghui Yang
Posted 7 years ago
POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard