Message Boards Message Boards

0
|
2276 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How can I show the x and y values of two points on the same Bode plot?

Posted 2 years ago

Dear All, I have actually two questions: 1. I have multiple transfer functions and I am showing their respective Bode magnitude plot in one plot. For example:

TF1 = TransferFunctionModel[{{{
    1.7607354217407793`*^7 + 15432.18944717527 s}}, 
   1.9007939847037688`*^7 + 17800.70861749659 s + 1. s^2}, s] 
TF2 = TransferFunctionModel[{{{
    3.9239734146090127`*^6 + 3281.037344551362 s}}, 
   6.16863218865207*^6 + 6389.425453315465 s + 1. s^2}, s]

I have identified the 3-dB cutoff for each of them and now I am displaying them as in the picture using Show. My code looks like this:

P1 = BodePlot [TFalpha1, PlotLayout -> "Magnitude", 
   PlotStyle -> Directive[Green, Thick], 
   Mesh -> {{{-3}}, {{16659.759374487337`}}}, 
   GridLinesStyle -> Directive[Green, Dashed], 
   GridLines -> {{16659.759374487337`}, None}, 
   MeshStyle -> PointSize[Large]];

P2 = BodePlot [TFCC , PlotLayout -> "Magnitude", 
   PlotStyle -> Directive[Orange, Thick], 
   Mesh -> {{{-3}}, {{5377.124388436974`}}}, 
   GridLinesStyle -> Directive[Orange, Dashed], 
   GridLines -> {{5377.124388436974`}, None}, 
   MeshStyle -> PointSize[Large]];

Show[P1, P2]

I used this code since I want to show where each of my 3-dB point projects at the w-axis. When I check individual plots they do have clear dashed lines on the w-axis (just like the green line in the picture, there is a dashed line in the Orange curve). But whenevr I try to combine them using Show, only the green line is there and the orange line corresponding to the Orange curve is disappeared. How can I get both the green and orange line plotted to show at what value the project on w-axis? A related question is how I can modify my code to also show where the points intersect with the y-axis? 2. Let's assume I have to show another point on the same curve (say the green one) which is 1.88 *wc (where wc is the 3-dB point) and have to depict where it intersects the w and y axes (just like the previous one). I want to show it as a different symbol than the cut-off point (which is green solid circle). Is there a way to do it?
I'll very much appreciate your help.
Regards,
Koushik

Attachment

Attachments:
2 Replies
Posted 2 years ago

Hi Koushik,

Use Epilog rather than GridLines.

P1 = BodePlot[TF1,
  PlotLayout -> "Magnitude",
  PlotStyle -> Directive[Green, Thick],
  Mesh -> {{{-3}}, {{16659.759374487337}}},
  MeshStyle -> PointSize[Large]]

P2 = BodePlot[TF2,
  PlotLayout -> "Magnitude",
  PlotStyle -> Directive[Orange, Thick],
  Mesh -> {{{-3}}, {{5377.124388436974}}},
  MeshStyle -> PointSize[Large]]

epilog1 = {Green, Dashed, 
   InfiniteLine[{{Log10@16659.759374487337`, -25}, {Log10@16659.759374487337`, 0}}]};

epilog2 = {Red, Dashed, 
  InfiniteLine[{{Log10@5377.124388436974, -25}, {Log10@5377.124388436974, 0}}]}

Show[P1, P2, Epilog -> {epilog1, epilog2}]

enter image description here

I don't understand the second part of your question. If you want to add additional horizontal or vertical lines or points, add them to the Epilog.

POSTED BY: Rohit Namjoshi

Dear Rohit, Thank you so much. I really appreciate your kind help. Regards, Koushik

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract