# Why do NDSolve and OutputResponse not evaluate non-analytic functions numerically?

test = OutputResponse[TransferFunctionModel[1/(1 + s), s], Exp[-(1/t)], {t, 0, 10}]


does not evaluate. If Exp[-(1/t)] is replaced by Exp[-t], it's fine.

Starting the numerical evaluation at t>0 does not help, either. (v9.0.1.0 on Mac OS). Thanks.

The same issue occurs with NDSolve:

NDSolve[{y'[t] + y[t] == Exp[-1/t], y[0] == 0}, y, {t, 0, 10}]


does not generate an interpolating function. Replacing Exp[-(1/t)] by Exp[-t] does.

-
This behavior seems rather strange, and some suspicious messages are produced. Starting from t == 1 doesn't help; changing Exp[-1/t] into Exp[-1/(t + 1*^-10)] does. Bug? – Oleksandr R. May 4 '14 at 19:53
Thanks! The t to t + eps trick does seem to work for both OutputResponse and NDSolve. – John Bechhoefer May 4 '14 at 23:01
It probably should be noted that it does help to start from a value larger than zero for NDSolve (at least if one adopts the initial condition), but not for OutputResponse... – Albert Retey May 6 '14 at 15:44

## 1 Answer

This is just an observation and a workaround for now. Instead of using OutputResponse with {t,0,limit}, just use t.

This forces M to give an analytical solution using DSolve (not as fast as numerical with the limit, but it does avoid the problem you see with t=0. This is why NDSolve also fails, since when using the limit, NDSovle is used vs. DSolve

sol = First@OutputResponse[TransferFunctionModel[1/(1 + s), s], Exp[-(1/t)], t]


Plot[Evaluate[sol], {t, 0, 10}]


-