# TransferFunctionModel and BodePlot shows different result between Mathematica and Matlab

I was doing the TransferFunctionModel and BodePlot. But the result from Mathematica and Matlab are different.

The function is as follows: Bi = TransferFunctionModel[(1 + 3*I*\[Omega])/(1 + 1.5*I*\[Omega]), \[Omega]]; BodePlot[Bi, GridLines -> Automatic, ImageSize -> 400, FrameLabel -> {{{"Magnitude (db)", None}, {None, "Frequency Transfer Function Inside"}}, {{"Phase(deg)", None}, {"Frequency (rad/sec)", None}}}, ScalingFunctions -> {{"Log10", "dB"}, {"Log10", "Degree"}}, PlotRange -> {{{0, 100}, Automatic}, {{0, 100}, {0, 20}}}, PlotStyle -> {Red, Thick}];

• How is the phase treated in each case? Phase can be wrapped between 0 to 2Pi or unwrapped to go to infinity. – Hugh Sep 21 '15 at 18:01
• Actually in both cases I didn't specify the phase range. The phase range in MM has negative part but in Matlab the phase is positive. – yangyang Sep 21 '15 at 19:11
• Without all the options in BodePlot,you'll get the same. – Phab Oct 1 '15 at 11:55

I'm getting a minimum phase of 0 in Mathematica as well.

Manipulate[tf = TransferFunctionModel[eq, s];

BodePlot[tf, GridLines -> Automatic, ImageSize -> 500,
FrameLabel -> {{{"Magnitude (db)", None}, {None,
"Bode Plot"}}, {{"Phase(deg)", None}, {"Frequency (rad/sec)",
None}}},
ScalingFunctions -> {{"Log10", "dB"}, {"Log10", "Degree"}},
PlotRange -> {{{0.1, 100}, Automatic}, {{0.1, 100},
Automatic}}], {eq, (1 + 3 s)/(1 + 1.5 s)}]
` • But eq should be (1+3*is)/(1+1.5*is). Did you miss the "i"? – yangyang Sep 22 '15 at 6:33
• @yangyang Your use of "i" is non standard. Usually there are no imaginary units in the Laplace domain and you only get them when you replace s with i w. The Mathematica Bode plot does this for you. It assumes you are putting in an s-plane transfer function and want to plot it on the frequency axis. You need to clarify what you are trying to do. – Hugh Sep 22 '15 at 13:56
• @yangyang As Hugh said, I substituted iw with s so that it would work with a document that I had written earlier that calculates from the Laplace space. As he also pointed out, your mistake was that TransferFunctionModel[] assumes Laplace domain and you didn't make the substitution of wi ->s. Now that I try it again using s*I, I'm getting the -300 you were mentioning earlier. – Brian G Sep 22 '15 at 14:31
• @BrianG I understand your point. Thank you for your help!!! – yangyang Sep 22 '15 at 14:48
• @BrianG I know what is the problem. If I use b=(1+3*s)/(1+1.5*s); then I got the same as MM. It seems the imaginary part "i" should not be there. – yangyang Oct 1 '15 at 11:28