# OutputResponse numerical error?

It shoud approach to 1 and remains at 1, but when time over 20s it deteriorates.

Mathematica 12.1

Plot[OutputResponse[    Rationalize[
TransferFunctionModel[
Unevaluated[{{(0.045 (0.005 + s) (1 + 10. s))/(
s^3 (1 + (0.09 (0.005 + s) (1 + 10. s))/(s^3 (2 + s))))}}], s,
SamplingPeriod ->None, SystemsModelLabels -> None]], UnitStep[t],
t] // Evaluate, {t, 0, 40}]

• Please show us the code text rather than the screenshot of it. Commented May 31, 2021 at 15:17
• And, please don't add bugs tage before WRI or the community has confirmed it as a bug. Commented May 31, 2021 at 15:32
• Strongly related, if not duplicate: mathematica.stackexchange.com/q/27505/1871 Commented May 31, 2021 at 15:39
• ok . I am glad to be educated. Commented May 31, 2021 at 15:39

## 1 Answer

One way is:

f = (0.045*(0.005 + s)*(1 + 10. s))/(s^3 (1 + (0.09*(0.005 + s)*(1 + 10. s))/(s^3*(2 + s))));

g = OutputResponse[TransferFunctionModel[{{f}}, s], UnitStep[t], {t, 0, 40}]

Plot[g, {t, 0, 40}, PlotRange -> All]


Workaround:

sys = Rationalize[(0.045*(0.005 + s)*(1 +
10. s))/(s^3 (1 + (0.09*(0.005 + s)*(1 + 10. s))/(s^3*(2 +
s)))), 0] // Factor // ExpandAll

u = UnitStep[t];
func = InverseLaplaceTransform[sys*LaplaceTransform[u, t, s], s, t];

Plot[func, {t, 0, 40}, PlotRange -> All]

• "OutputResponse can't be calculated analytically is very complex. Only way is by numerics." No, in this case it can. (Takes about 50 seconds on my laptop. ) We then just need a higher WorkingPrecision. Of course pure numeric approach shown by you is better. Commented May 31, 2021 at 15:38