Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Help with Manipulate
Replies: 1   Last Post: Nov 15, 2013 6:54 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
emammendes@gmail.com

Posts: 143
Registered: 8/22/05
Help with Manipulate
Posted: Nov 14, 2013 1:50 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


Hello

I need to create a simple demonstration based upon an exercise on poisson counting processes. Here is the code

Manipulate[n/Total[z],Style["Poisson Arrival Times",18,Bold],"",Delimiter,{{z,Flatten[{0,RandomVariate[Quiet@ExponentialDistribution[\[Lambda]],n-1]}]},Button["random",z=Flatten[{0,RandomVariate[Quiet@ExponentialDistribution[\[Lambda]],n-1]}]]&,Appearance->"Labeled"},"",Delimiter,{{\[Lambda],2,"\[Lambda]"},1,100,1,Appearance->"Labeled"},"",Delimiter,{{n,10000,"n"},1,1000000,1000,Appearance->"Labeled"},SaveDefinitions->True]

The idea is to generate a sequence of random numbers, then take the sum of it and keep the last value. Every time I hit "random"a new sequence is created.

The above code returns the following error msg

RandomVariate::array : "\"The array dimensions -1 + n given in position 2 \
of RandomVariate[ExponentialDistribution[=CE=BB], -1 + n] should be a list of \
non-negative machine-sized integers giving the dimensions for the result. \""

and some weird output. After hitting "random", the output is what I expect but the whole Manipulate output is still red indicating that there are problems.

Could you be so kind to point out what I did wrong and how to fix it? I feel that I did not quite get how Manipulate works.

Many thanks

Ed



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.