Program Transfer function and plot

I need to program a transfer function T(s) = 1/(s^2+Bs+1) and simulate the response of a unit step input of the Force for each value of B which i used in my range my B values are 4,2,1.8,1.4.......

tfm = TransferFunctionModel[(1)/(s^2 + Bs + 1), s];
tfm[I Range[4,2,1.8,1.4,1,0.6,0.2,0.02]]
Plot[Abs[tfm[I f]], {f, 0, 5}]


What am I doing wrong?

• For one thing, you are not using Range correctly. Note the error: Range called with 8 arguments; between 1 and 3 arguments are expected. Feb 9, 2020 at 18:37

Something to get you started. Added stiffness as well, which you could always set to 1.

Clear["Global*"];

Manipulate[
Module[{tf, y, t},
tf = TransferFunctionModel[1/(s^2 + b s + k), s];

(*specific time forces numeric, much faster*)
y = OutputResponse[tf, UnitStep[t], {t, 0, 50}];

Plot[Evaluate@y, {t, 0, 50}, PlotRange -> {{0, 50}, {-.1, 2}},
Frame -> True,
FrameLabel -> {{"y(t)", None}, {"t", "step response"}},
GridLines -> Automatic, GridLinesStyle -> Dashed,
ImageSize -> {300, 300}, PlotStyle -> Red, AspectRatio -> 1]
],

(*controls*)
Grid[{
{Row[{"Damping B: ", PopupMenu[Dynamic[b], {0.02, 4, 2, 1.8, 1.4, 1, 0.6, 0.2}]}]},
{Row[{"Stiffness k ", Manipulator[Dynamic[k, {k = #} &], {1, 5, .1},
ImageSize -> Tiny], Dynamic[k]}]}
}
],
ContinuousAction -> False,
TrackedSymbols :> {b, k}
]
`