4
$\begingroup$

I am trying to plot step response of a system with an approximated delay. This code

a = 2; pa = PadeApproximant[Exp[-s], {s, 0, {3, 3}}]; sys = TransferFunctionModel[pa/(s^2 + s/a + 1), s]; out = OutputResponse[sys, UnitStep[t], {t, 0, 20}]; Plot[out, {t, 0, 20}, PlotRange -> All] 

produces discontinuous plot below

disc

If we change the value of a to be positive number other than 2, then the discontinuities disappear. How to remove these discontinuities for $a=2$? I am using Wolfram 14.2.

$\endgroup$
2
  • 3
    $\begingroup$ Re@out seems work. Or ReImPlot. $\endgroup$ Commented Feb 5 at 12:19
  • 2
    $\begingroup$ The discontinuities disappear when you write "a=2." instead of "a=2". $\endgroup$ Commented Feb 5 at 13:12

1 Answer 1

5
$\begingroup$

Add Chop to clean it a little. Since your OutputResponse is numerical and not analytical (because you used {t, 0, 20} and not just t) the result when looking at it had lots of numerical artifacts.

a = 2; pa = PadeApproximant[Exp[-s], {s, 0, {3, 3}}]; sys = TransferFunctionModel[pa/(s^2 + s/a + 1), s]; out = OutputResponse[sys, UnitStep[t], {t, 0, 20}]; Plot[Chop@out, {t, 0, 20}, PlotRange -> All] 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.