# How to combine Manipulate and OutputResponse to manipulate a transfer function

The webpage on Manipulate provides an example on section Examples > Applications of how to manipulate two parameters (the initial conditions) of an Initial Value Problem (ODE with initial conditions), which is the following (I've removed Epilog and ImagePadding because they're not interesting):

Instead of plotting the solution to an ODE, I'd like to plot the step response of a system given its transfer function. The transfer function is:

$$\dfrac{\dfrac{5}{s^2+2s} K_1}{1+\dfrac{5}{s^2+2s} (K_2 s+K_1)} \tag*{}$$

where $$K_1$$ and $$K_2$$ are the parameters I want to manipulate. So, tried to change Evaluate with the following code:

OutputResponse[TransferFunctionModel[(5/(s^2 + 2 s)*K1)/(1 + 5/(s^2 + 2 s)*(K2*s + K1)), s], UnitStep[t], {t, 0, 10}]


but Mathematica doesn't show the plot:

What's wrong? What would be the appropriate code?

• This works:Manipulate[ fun = OutputResponse[ TransferFunctionModel[(5/(s^2 + 2 s)*K1)/(1 + 5/(s^2 + 2 s)*(K2*s + K1)), s] , UnitStep[t], {t, 0, 10}][[1]]; Print[fun]; Plot[fun, {t, 0, 4}] , {{K1, 1}, 0, 3}, {{K2, 1}, 0, 3}] Nov 7, 2020 at 14:50

Manipulate[Plot[Evaluate@