Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Piecewise bug in Mathematica 8.01?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123134] Re: Piecewise bug in Mathematica 8.01?
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Thu, 24 Nov 2011 06:56:55 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jaio99$eqd$1@smc.vnet.net>

On 23/11/2011 12:17, Dario wrote:
> Hello everyone
>
> I'm currently simulating some turbulent processes that incorporate a
> large number of random steps.
> I used Mathematica's 8.01 Piecewise to produce a function that has
> different (random) values at different times. This function is then
> used to calculate some differential equations.
> Through some debugging I figured out that there is something wrong
> with Mathematica's Piecewise when a large number of intervals is used.
> Here is the isolated piece of code that I use to generate the random
> values function.
>
> ******************************************************************
> list3 = {};
> list4 = {};
> j = 0;
> Maxt = 40000;
> dt = 1;
> list3 = Table[RandomReal[{0.01, 0.03}], {i, 0, Maxt, dt}];
> list4 = Table[j<  t<= j + dt, {j, 0, Maxt, dt}];
> anoise = Thread[{list3, list4}];
> a = Piecewise[anoise];
> Plot[a, {t, 0, Maxt}]
> *****************************************************************
>
> The problem I detected has to do with the number of intervals that
> Piecewise uses, in this specific case is defined by Maxt.
> If Maxt is bigger then 45000 then Mathematica crashes and all values
> in memory are lost.
> I've tried this in different PCs with different OS (Windows 7 and
> Linux) and the same thing happens.
> I've also tried to play around with $MaxPiecewiseCases but still no
> luck.
> Does someone has any idea what might be causing this?
>
> Best Regards
> D=E1rio Passos
>
I reproduced it with 8.04 on 64-bit Windows. Clearly it is a bug - I 
suggest you report it through Wolfram support.

David Bailey
http://www.dbaileyconsultancy.co.uk




  • Prev by Date: Non trivial substitution in a very long output
  • Next by Date: Re: What is the point of having Initializations in DynamicModule and Manipulate?
  • Previous by thread: Re: Piecewise bug in Mathematica 8.01?
  • Next by thread: Aligning 2 Sets of Axes at {0,0}; Rotated & Standard Position