I'm trying to do a Bode plot in 3D for the function below, but there is no built-in function for that.
How can I do that? It would also be nice if you could use a mesh to make it easier to see.
tf = s^2/(s^2 + 2 s + 5)
The shape of the plot may not be same as in the image, but it is a 3D object like that.
In a 2D Bode plot, s
is replaced with i*w
and then the magnitude/modulus of the function with frequency w
is plotted. However, in a 3D plot you replace s
with σ + i*w
and plot the magnitude of the function with a different σ
and w
.
tf = s^2/(s^2 + 2 s + 5);
mag = Abs[ComplexExpand[tf /. s -> \[Sigma] + I*w]];
Plot3D[mag, {\[Sigma], -1000, 1000}, {w, -100, 100},
ScalingFunctions -> {None, None, "Log"}]
s
withi*w
and then plot the magnitude/modulus of the function with frequencyw
. However, in 3D plot you should replaces
withσ + i*w
and plot the maginitude of the function with differentσ
andw
. $\endgroup$ComplexPlot3D[tf, {s, -2 - 3 I, 0 + 3 I}, AxesLabel -> {\[Sigma], I*\[Omega]}, BoxRatios -> {2, 3, 1}]
$\endgroup$σ = 0
andw
? $\endgroup$