0
$\begingroup$

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}];

$\endgroup$
  • $\begingroup$ How is the phase treated in each case? Phase can be wrapped between 0 to 2Pi or unwrapped to go to infinity. $\endgroup$ – Hugh Sep 21 '15 at 18:01
  • $\begingroup$ 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. $\endgroup$ – yangyang Sep 21 '15 at 19:11
  • $\begingroup$ Without all the options in BodePlot,you'll get the same. $\endgroup$ – Phab Oct 1 '15 at 11:55
4
$\begingroup$

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)}]

enter image description here

$\endgroup$
  • $\begingroup$ But eq should be (1+3*is)/(1+1.5*is). Did you miss the "i"? $\endgroup$ – yangyang Sep 22 '15 at 6:33
  • 1
    $\begingroup$ @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. $\endgroup$ – Hugh Sep 22 '15 at 13:56
  • $\begingroup$ @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. $\endgroup$ – Brian G Sep 22 '15 at 14:31
  • $\begingroup$ @BrianG I understand your point. Thank you for your help!!! $\endgroup$ – yangyang Sep 22 '15 at 14:48
  • 1
    $\begingroup$ @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. $\endgroup$ – yangyang Oct 1 '15 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.