|
[Sponsors] |
May 5, 2006, 01:06 |
how to generate random number?
|
#1 |
Guest
Posts: n/a
|
Hi;
i want to use a series a random number between 0 and 20, what should i do ? regards |
|
May 5, 2006, 03:38 |
Re: how to generate random number?
|
#2 |
Guest
Posts: n/a
|
Dear ztdep,
You can look out for a lot of random number generators available on net. A simple option could be to use the 'rand()' command in MATLAB. For eg: rand(1) generates a random number between 0 and 1. Since you need the number between 0 and 20, all you need to do is use rand(1).*20, which would generate a random number in [0,20]. Note that all random number generators are pseudo-random, and there is nothing deterministic about multiplying the random number by 20. Hope this helps Regards, Ganesh |
|
May 5, 2006, 04:28 |
Re: how to generate random number?
|
#3 |
Guest
Posts: n/a
|
Thank you very much! so what is the meaning of the pseudo-random? regards
|
|
May 5, 2006, 06:31 |
Re: how to generate random number?
|
#4 |
Guest
Posts: n/a
|
Dear ztdep,
Though we make use of a random number generator, it works on an underlying algorithm, which brings in an element of determinism. Therefore, these generators are referred to as pseudo-random, mening they are random generators, but do have an element of determinism owing to an underlying algorithm. Regards, Ganesh |
|
May 6, 2006, 06:53 |
Re: how to generate random number?
|
#5 |
Guest
Posts: n/a
|
Hello friends, I saw this message. I am with a question. Why do we need random numbers? What is its relation with CFD? Regards, VVJ.
|
|
May 6, 2006, 08:52 |
Re: how to generate random number?
|
#6 |
Guest
Posts: n/a
|
Dear Vijesh,
There are many applications for random number generators in various fields. In CFD, may be their use is not too much, however one which comes to my mind is for use in random perturbation of grid points, to study effect of grid distortions on accuracy, scheme stability etc ... Regards, Ganesh |
|
May 8, 2006, 07:20 |
Re: how to generate random number?
|
#7 |
Guest
Posts: n/a
|
Hi:
i use it to generate a random heat source so as to validate my reduced order model ! regards |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mesh file for flow over a circular cylinder | Ardalan | Main CFD Forum | 7 | December 15, 2020 14:06 |
[mesh manipulation] Mesh Refinement | Luiz Eduardo Bittencourt Sampaio (Sampaio) | OpenFOAM Meshing & Mesh Conversion | 42 | January 8, 2017 13:55 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 05:03 |
Smooth Grid Error! Help | seasoul | FLUENT | 1 | March 24, 2008 11:56 |
-- gaussian random number -- | rana | FLUENT | 0 | November 18, 2007 23:06 |