5
$\begingroup$

From the BodePlot function, I would like to plot the vertical line at horizontal axis equal to 10 as in the magnitude plot below and indicate the coordinate of the intersection point.

Could anyone help me to do this?

Thank you.

BodePlot[1/(1 + s/10 + s^2/100)]

enter image description here

$\endgroup$

3 Answers 3

6
$\begingroup$
bplts = BodePlot[1/(1 + s/10 + s^2/100), 
 GridLines -> {{{10}, None}, {{10}, None}}, GridLinesStyle -> Red, 
 Mesh -> {{{10}}, {{10}}}, MeshStyle -> PointSize[Large]]

Mathematica graphics

Update: You can show the coordinates of the intersection by post-processing the graphics output to add Tooltip or Text:

(Normal /@ bplts) /. Point[p__] :> Tooltip[Point[p], p]

Mathematica graphics

(Normal /@ bplts) /. 
 Point[p__] :> {Point[p], Red, Text[Style[p, 16], p, Left]}

Mathematica graphics

$\endgroup$
3
  • $\begingroup$ Thanks. As the comment in David's answer, I would like to show the coordinate of intersection point something like (10, 0) on the plot. How can I do that? $\endgroup$
    – emnha
    Dec 2, 2016 at 18:31
  • $\begingroup$ @anhnha, please see the update. $\endgroup$
    – kglr
    Dec 4, 2016 at 19:42
  • $\begingroup$ Thank you. I am trying to understand the code. The normal function is new to me. I am reading from help section but it seems abstract. $\endgroup$
    – emnha
    Dec 4, 2016 at 22:17
5
$\begingroup$
BodePlot[1/(1 + s/10 + s s/100),
 Epilog -> Line[{{1, -100}, {1, .11}}]]

or

BodePlot[1/(1 + s/10 + s s/100),
 Epilog -> {{Red, Line[{{1, -100}, {1, .11}}], 
            {PointSize[0.05], Point[{1, .11}]}}, 
            {Red, Line[{{1, -90}, {1, -200}}]}}]

enter image description here

If you want to have the points calculated automatically for your choice of abscissa:

mysvalue = 1;
f[s_] := 1/(1 + s/10 + s s/100);
BodePlot[f[s],
 Epilog -> {{Red, 
    Line[{{mysvalue, -100}, {mysvalue, f[mysvalue]}}], 
          {PointSize[0.05], 
    Point[{mysvalue, f[mysvalue]}]}}, 
   {Red, Line[{{mysvalue, -90}, {mysvalue, -200}}]}}]

Apparently abscissas are represented on a log scale here.

$\endgroup$
2
  • $\begingroup$ Thank you. I would like to indicate the coordinate of the intersection point between the vertical line and the curve. How to do that automatically without any hand calculation before? $\endgroup$
    – emnha
    Dec 2, 2016 at 18:20
  • $\begingroup$ Hi again, I still can't do it. I run the code but it doesn't show the coordinate of intersection point something like (10, 0) on the plot. How can I do that? $\endgroup$
    – emnha
    Dec 2, 2016 at 18:30
4
$\begingroup$
g[s_] = 1/(1 + s/10 + s^2/100);

pt1 = {10, Log10[g[10.]]}

(*  {10, -0.477121}  *)

pt2 = {10, Arg[g[I 10.]]/Degree}

(*  {10, -90.}  *)

BodePlot[1/(1 + s/10 + s^2/100),
 Epilog -> {
   {Red, AbsolutePointSize[4],
    Tooltip[Point[{1, pt1[[2]]}],
     pt1]},
   {Red, AbsolutePointSize[4],
    Tooltip[Point[{1, pt2[[2]]}],
     pt2]}},
 GridLines -> {{{10}, None}, {{10}, None}},
 GridLinesStyle -> Red]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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