Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9746 > unrolled thread

Re: LogLogPlot encounters Infinite expression

Started by"djmpark" <djmpark@comcast.net>
First post2012-04-22 10:06 +0000
Last post2012-04-22 10:06 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: LogLogPlot encounters Infinite expression "djmpark" <djmpark@comcast.net> - 2012-04-22 10:06 +0000

#9746 — Re: LogLogPlot encounters Infinite expression

From"djmpark" <djmpark@comcast.net>
Date2012-04-22 10:06 +0000
SubjectRe: LogLogPlot encounters Infinite expression
Message-ID<jn0l80$4tr$1@smc.vnet.net>
This looks like a bug in the internal initial processing for LogLogPlot,
possibly in trying to determine the y axis Range - although I don't know why
it would do that first.

If one does the following, the routine never samples outside of the
specified domain.

f[x_] := Piecewise[{{0.001, x < 10}}, Exp[x/20]] 
Reap[LogLogPlot[1/f[x], {x, 11, 20},
  EvaluationMonitor :> Sow[x]]] 

If we change back to zero, it bombs before sowing any x values.

The simplest solution is to modify the plot function for the purpose of this
particular plot.

LogLogPlot[1/Exp[x/20], {x, 11, 20}] 

With the Presentations Application you could specify the ticks and roll your
own LogLog curve with some extra work but without having to modify the f
function.

<< Presentations` 

xticks = CustomTicks[Log, {1, 2, {12, 14, 16, 18, 20}/10, {}}];
yticks = CustomTicks[Log, {-1, 0, Range[3.5, 6, 0.5], {}}];
Draw2D[
 {Draw[Log[1/f[E^logx]], {logx, Log[11], Log[20]}]},
 AspectRatio -> 0.6,
 Axes -> True,
 Ticks -> {xticks, yticks}]


David Park
djmpark@comcast.net 
http://home.comcast.net/~djmpark/index.html 


From: John_V [mailto:jvillar.john@gmail.com] 

If I try this:

f[x_] = Piecewise[{{0, x < 10}}, Exp[x/20]] LogLogPlot[1/f[x], {x, 11, 20}]

the result is an error message (Infinite expression 1/0 encountered) and a
plot that has axes but no graph.

Notice that although 1/f is indeed 1/0 for x<10, the requested plot range
does not include x<10. The function is well-defined within the requested
plot range. Does anyone know what's going on with this?

John

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web