Problems with plotting a function

73 Views Asked by At

I can't find out why maple won't plot a type of function the way it's supposed to be. Here are the functions I need to plot

I'm considering B=24, h=0, t=10.2 and epsilon as the only variable.

The result I'm getting from mapple is this one here. But I'm suppose to get something like this. The problematics ones are those in the middle, they correspond to E3 and E4.

Does anyone has any idea of what could be happening?

2

There are 2 best solutions below

1
On BEST ANSWER

This appears to be an example where the new (Maple 2022) adaptive plotting scheme goes awry.

It can be remedied here by forcing the previous default scheme. Using Robert's formulation of the equations:

B:= 24: h:= 0: t:= 10.2: 
E1:= sqrt(B^2 + epsilon^2 + h^2 + 4*t^2 
   + 2*sqrt(epsilon^2 * B^2 + 4*B^2 * t^2 + 
   epsilon^2*h^2))/2;
E2:= -E1;
E3:= sqrt(B^2 + epsilon^2 + h^2 + 4*t^2 
   - 2*sqrt(epsilon^2 * B^2 + 4*B^2 * t^2 + 
   epsilon^2*h^2))/2;
E4:= -E3;

plot([E1,E2,E3,E4], epsilon = -45 .. 45,
     adaptive = true);

enter image description here

1
On

What you're "supposed to get" seems to have two curves with each label E0 to E3, solid and dotted, and no E4's.

It might help if you provided the actual Maple code you used. But here's what I get:

B:= 24: h:= 0: t:= 10.2: 
E1:= sqrt(B^2 + epsilon^2 + h^2 + 4*t^2 
   + 2*sqrt(epsilon^2 * B^2 + 4*B^2 * t^2 + epsilon^2*h^2))/2;
E2:= -E1;
E3:= sqrt(B^2 + epsilon^2 + h^2 + 4*t^2 
    - 2*sqrt(epsilon^2 * B^2 + 4*B^2 * t^2 + epsilon^2*h^2))/2;
E4:= -E3;
plot([E1,E2,E3,E4], epsilon = -45 .. 45);

enter image description here

I'm guessing your problem is with how the intersections with the $x$ axis look. This is a problem with roundoff error, I think. Note that with $h = 0$,

$$ B^2 + \epsilon^2 + 4 t^2 - 2 B \sqrt{\epsilon^2 + 4 t^2} = \left(B - \sqrt{\epsilon^2 + 4 t^2}\right)^2 $$ so your $$E3 = \left| B - \sqrt{\epsilon^2 + 4 t^2} \right|/2 $$ With that for $E3$ (and of course $E4 = -E3$), I get this:

enter image description here