Re: Re: Strange Manipulate+ContourPlot behavior
- To: mathgroup at smc.vnet.net
- Subject: [mg82204] Re: [mg82172] Re: Strange Manipulate+ContourPlot behavior
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Sun, 14 Oct 2007 06:21:11 -0400 (EDT)
- References: <fei3de$qn1$1@smc.vnet.net> <200710110416.AAA21323@smc.vnet.net> <16233724.1192265949170.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
With a fresh kernel in v6.0.1, none of THOSE results are Indeterminate: e = (b (a - a p + b p))/(2 a b + (a - b)^2 p); rules = {a -> 0, b -> 0, p -> 0}; Fold[ReplaceAll[#1, #2] &, e, #] & /@ Permutations[rules] {1, 1, 0, 0, 1/2, 1/2} $Version "6.0 for Microsoft Windows (32-bit) (June 19, 2007)" That's not to say some other evaluation order can't occur, of course. Bobby On Sat, 13 Oct 2007 03:05:49 -0500, Yaroslav Bulatov <yaroslavvb at gmail.com> wrote: > I suspect the discrepancy between "Manipulate[ContourPlot[e" and > "Manipulate[ContourPlot[Evaluate[e" has to do with automatic > simplification rules. The expression being plotted evaluates to 1, 0, > 1/2 or Indeterminate depending on the order in which replacement rules > are applied. > > e = (b (a - a p + b p))/(2 a b + (a - b)^2 p); > rules = {a -> 0, b -> 0, p -> 0}; > Fold[ReplaceAll[#1, #2] &, e, #] & /@ Permutations[rules] > > Is it possible to disable automatic simplification rules to prevent > expressions like a / (2 a) simplifying to 1/2? > > > On Oct 12, 12:11 am, Syd Geraghty <sydgerag... at mac.com> wrote: >> Not so weird... >> >> In[]:= a = 0; b = 0; p = 0; (b (a - a p + b p))/(-2 a b (-1 + p) + >> a^2 p + b^2 p) >> >> Out[]:= Indeterminate >> >> Syd >> >> Syd Geraghty B.Sc., M.Sc. >> sydgerag... at mac.com >> San Jose, CA >> >> On Oct 10, 2007, at 9:16 PM, Will Robertson wrote: >> >> > On Oct 10, 5:44 pm, Yaroslav Bulatov <yarosla... at gmail.com> wrote: >> >> Manipulate[ >> >> ContourPlot[( >> >> b (a - a p + b p))/(-2 a b (-1 + p) + a^2 p + b^2 p), {a, 0, 1}, >> >> {b, >> >> 0, 1}], {p, 0, 1}] >> >> > That is weird. Sticking in an Evaluate[] around the expression fixes >> > the problem -- until the slider is first moved. I guess I'd just >> > recommend avoiding p = 0 ... :) >> >> > Will > > > > -- DrMajorBob at bigfoot.com
- References:
- Re: Strange Manipulate+ContourPlot behavior
- From: Will Robertson <wspr81@gmail.com>
- Re: Strange Manipulate+ContourPlot behavior