# BodePlot to calculate the amplitude and phase at a specific frequency

I have transfer function:

$$W=\frac{1}{s+1}$$

tf = TransferFunctionModel[{{1/(s + 1)}}, s]
BodePlot[tf, {.01, 100}]


It is very simple to construct a Bode diagram, but how to calculate the amplitude and phase shift with the help of 'BodePlot' at a selected frequency, for example $$\omega=2\pi$$, is not clear...

tf = TransferFunctionModel[{{1/(s + 1)}}, s];
freqs = {{π, 2 π}};

BodePlot[tf, {.01, 100}, Mesh -> Table[freqs, 2],
MeshStyle -> Directive[PointSize[Medium], Red]]


An example:

ss = StateSpaceModel[{3 y''[t] - 2 y[t] == u[t] + u'[t]}, {y[t], y'[t]}, {u[t]}, y[t], t];
tf = TransferFunctionModel[ss, s];

points = {Log10@#,20*Log10@Abs@tf[\[ImaginaryJ] #][[1, 1]]} & /@ {0.1, 1, 10} // N;

BodePlot[ss, {0.01, 100}, ImageSize -> 300, GridLines -> Automatic,
Epilog -> {PointSize[Medium], Red, Point[points]}, PlotLayout -> "Magnitude"]


pointsArg = {Log10@#,Arg@tf[\[ImaginaryJ] #][[1, 1]]*180/\[Pi]} & /@ {0.1, 1, 10} // N;

BodePlot[ss, {0.01, 100}, ImageSize -> 300, GridLines -> Automatic,
Epilog -> {PointSize[Medium], Red, Point[pointsArg]}, PlotLayout -> "Phase"]


• @dtn Do the calculation as I demonstrated. Replace only tf with 1/(1+s).
– rmw
Commented Jun 12, 2021 at 12:52
– ayr
Commented Jun 12, 2021 at 12:56

Very simple solution and using Bode plot

fr = ReplaceAll[1/(s + 1), s -> Sqrt[-1] \[Omega]];

LogLinearPlot[20 Log10[Abs[fr]], {\[Omega], 0.001, 100},
PlotRange -> All];

LogLinearPlot[Arg[fr], {\[Omega], 0.001, 100}, PlotRange -> Full];

\[Omega] = 2 Pi;

N[Abs[fr]];

N[Arg[fr]];