1
$\begingroup$

I wrote the code below to plot the function shown over two regions. Mathematica plots the function across the two regions (r from 0 to 2) without recognizing a discontinuity exists at r = 1 (a divide by zero). The limit as r->1 is indeed x/s which is 0.5 in this case (which is correct) ...

Question: Why does Mathematica plot this function as if it is smooth over the interval for r being [0,2] without complaining about r=1.

x = 10; s = 20; AA = Plot[(1 - r^x)/(1 - r^s), {r, 0, 1}, PlotStyle -> Directive[Black, AbsoluteThickness[1.75]], PlotRange -> All, BaseStyle -> {FontFamily -> "Times", FontWeight -> "Bold", FontSize -> 14}]; BB = Plot[(1 - r^x)/(1 - r^s), {r, 1, 2}, PlotStyle -> Directive[RGBColor[1, 0, 0], AbsoluteThickness[1.75]], PlotRange -> All, BaseStyle -> {FontFamily -> "Times", FontWeight -> "Bold", FontSize -> 14}]; Show[AA, BB, AxesOrigin -> {0, 0}, PlotRange -> All, Ticks -> {{0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2}, {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1}}, BaseStyle -> {FontFamily -> "Times", FontWeight -> "Bold", FontSize -> 14}] 
$\endgroup$
2

1 Answer 1

3
$\begingroup$

It doesn't complain, because you usually don't want it to complain. Note the documentation for Plot:

With the default settings Exclusions->Automatic and ExclusionsStyle -> None, Plot breaks curves at discontinuities and singularities it detects. Exclusions -> None joins across discontinuities and singularities.

So your plot is actually broken, you just don't see it unless you make it more visible:

x = 10; s = 20; Plot[(1 - r^x)/(1 - r^s), {r, 0, 2}, PlotStyle -> Black, PlotRange -> All, ExclusionsStyle -> Directive[AbsoluteThickness[10], Red]] 

enter image description here

$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.