Why random number blocks have the same randomness?

5 vues (au cours des 30 derniers jours)
israa
israa le 9 Sep 2014
Commenté : israa le 9 Sep 2014
Hi all
I have 10 nodes , each with trigger input. When there is a trigger hit the node will send a message.
The trigger consist of two Random Source blocks with one Relational Operator block ( < operand) as shown in first picture.
The first Random Source block parameters : min number 1 , max number 10
The second Random Source block parameters : min number 1 , max number 5
The problem is that all the 10 nodes have the same trigger input value (as shown in second picture), thats mean all Random Source blocks have the same randomness! Is this problem belongs to MATLAB solver issues?

Réponse acceptée

dpb
dpb le 9 Sep 2014
From the doc I find the following interesting note--
"To use other algorithms supported by MATLAB in a Simulink model, generate a stream of random numbers in MATLAB, and store the output as a .mat file. Use this .mat file as the random number input for your simulation. For more information, see Creating and Controlling a Random Number Stream. To create multiple independent streams using MATLAB, see Multiple streams."
"Note: Using multiple seeds to generate multiple parallel independent streams for a generator algorithm is not recommended for the mcg16807 algorithm. Instead, use the method described above."
Also, unless you set the seed to the RNG differently, it is documented that the result is repeatable for a given initial seed. I'd presume this is probably the cause of your getting the same generation from each.
NB: I've never seen a Simulink installation; just reading the doc...
  1 commentaire
israa
israa le 9 Sep 2014
Thanks alot ..I change the RNG to produce unrepeatable random numbers , and its work good

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by