# how to generate random number?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 5, 2006, 00:06 how to generate random number? #1 ztdep 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, 02:38 Re: how to generate random number? #2 ganesh 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, 03:28 Re: how to generate random number? #3 ztdep Guest   Posts: n/a Thank you very much! so what is the meaning of the pseudo-random? regards

 May 5, 2006, 05:31 Re: how to generate random number? #4 ganesh 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, 05:53 Re: how to generate random number? #5 vijesh joshi 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, 07:52 Re: how to generate random number? #6 ganesh 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, 06:20 Re: how to generate random number? #7 ztdep Guest   Posts: n/a Hi: i use it to generate a random heat source so as to validate my reduced order model ! regards