Hi All!
I have generated a “For” loop which results random number array called v1, I need to sum it with the same “For” loop (this time this “For” loop generates another number set). And I need to continue summing this for 2000 set of different random number set .
How can I build the code? does it sound like my “For” loop in another for loop?
\[Delta]t = 0.2; tmax = 5
imax = tmax/\[Delta]t
f = {1, 0}
T = 273
th = E^-\[Delta]t
nu = {}
For[v = {0, 0}; i = 1, i <= 7, i++,
If[RandomReal[] < th, v = v + f \[Delta]t,
v = RandomVariate[NormalDistribution[0, Sqrt[T]], {2}]];
v1 = AppendTo[nu, v]]
v1
Thank you very much for your kind help.
Thanks,
Lakshitha