3

How can I get rid of red vertical line in below plot? Could any onehelp me?

x = 0.1;
tr = -0.0;
dp = -0.2;
xr = -0;
f = dp Cos[2 theta] + tr;
G = 8 I; 
inside = (xr + G dp x Cos[theta] Sin[theta]^2)/f^2 + (1 - 2 tr /f)^2;
lambda1 = f (1 + inside^0.5); lambda2 = f (1 - inside^0.5);
qq1 = Plot[Re[lambda1], {theta, 0, Pi}, 
   PlotStyle -> ({Red, Dashing[#]} & /@ {Large, Medium})] ;
qq2 = Plot[Re[lambda2], {theta, 0, Pi}, 
   PlotStyle -> ({Red, Dashing[#]} & /@ {Large, Medium})];
Marco
  • 153
  • 5

2 Answers2

2

EDIT: Solution for version 10.3.1

$Version

(* "10.3.1 for Mac OS X x86 (64-bit) (December 9, 2015)" *)

x = 1/10;
tr = 0;
dp = -1/5;
xr = 0;
f = dp Cos[2 theta] + tr;
G = 8 I;
inside = (xr + G dp x Cos[theta] Sin[theta]^2)/f^2 + (1 - 2 tr/f)^2;

Separate lambda1 into its Re and Im components

lambda1 = f (1 + inside^(1/2)) // 
    ComplexExpand[#, TargetFunctions -> {Re, Im}] & // Simplify;

Extracting the Re component

lambda1Re = lambda1 /. I -> 0;

Use FunctionDomain to determine the values for the Exclusions

FunctionDomain[{lambda1Re, 0 <= theta <= Pi}, theta] //
 Simplify[#, 0 <= theta <= Pi] &

enter image description here

lambda2 = f (1 - inside^(1/2));

qq = Plot[{Re[lambda1], Re[lambda2]}, {theta, 0, Pi}, 
     PlotStyle -> ({#, Dashing[Large]} &) /@ {Red, Blue}, 
  Exclusions -> {-2*ArcTan[1 - Sqrt[2]], 2*ArcTan[1 + Sqrt[2]]}]

enter image description here

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
1

At least for the first plot qq1 you can find coordinates of discontinuities

root1 = theta /. FindRoot[Re[lambda1], {theta, 0.8}]
root2 = theta /. FindRoot[Re[lambda1], {theta, 2.4}]

and use Exclusions to get rid of the vertical lines

qq1 = Plot[Re[lambda1], {theta, 0, Pi}, 
      PlotStyle -> ({Red, Dashing[#]} & /@ {Large, Medium}), 
      Exclusions -> {{theta == root1}, {theta == root2}}];

However I could not find roots for Re[lambda2]...

K.J.
  • 456
  • 2
  • 10