# yade-users team mailing list archive

## R: Re: Uniform distribution

```Hi Bruno,

thanks for fixing the problem.
The distribution is uniform ANYWAY
(I was wrong in my previous email). To check it I have just created a routine
in py to see how many particles belong to a specific radius interval, having
previously divided the actual radius range in some intervals (if it is a
uniform distribution we see more or less the same number of particles falling
in each interval). If you are interested see the attached py script.

Chiara

>----Messaggio originale----
>Da: bruno.chareyre@xxxxxxxxxxx
>Data: 13/01/2010
18.03
distribution
>
>It is fixed. Tell me if you find problems again.
>
>Bruno
>

>Bruno Chareyre a écrit :
>> I found a problem I think. Thank you for that.
>>
This line is in fact generating r/rmean between (1- 0.5dev) and (1 +
>> 0.5
dev). I'll fix in a minute.
>>
>> Real r=(rnd()-.5)*rRelFuzz*rMean+rMean;
>>
>>
It doesn't explain non uniformity though. You are using a recent
>> version
right (I fixed a distribution bias in r1865)?
>>
>> Bruno
>>
>>> Hi all,
>>>

>>> perhaps (but I could be wrong) I found an error in the generation of
>>> a
>>> As some have already pointed
out in previous emails the uniform
>>> distribution is such that:
>>>
>>>
R_min = R_mean * (1-
>>> StdDev)
>>> R_max = R_mean * (1+StdDev)
>>>
>>> In
Yade we define a StdDev and a R_mean and with such values we
>>> generate the
distribution but if I check the results in terms of
>>> R_max and R_min, I do
not see a correspondence with the values I
>>> should obtain as performed
above.
>>> Moreover I have tried to see if the distribution is uniform between

>>> the values of R_max and R_min I obtain from Yade and actually between
>>>
them the distribution is not uniform. So, what's wrong here?
>>> I need to use
a uniform distribution, I have tried to look at the
>>> possible available
distributions in boost but what I need is that one
uniform_real<>(0,1)) that to me doesn't work
>>> properly and I do not
understand why.
>>> Any suggestions?
>>> Thanks a lot,
>>>
>>> Chiara
>>>
>>>
_______________________________________________
>>> Mailing list: https:

>>> More help   : https:
>>>
>>>
>>
>>
>
>
>--
>_______________
>Bruno
Chareyre
>Associate Professor
>Grenoble INP
>Lab. 3SR
>BP 53 - 38041, Grenoble
cedex 9 - France
>Tél : 33 4 56 52 86 21
>Fax : 33 4 76 82 70 43

>________________
>
>
>_______________________________________________
>Mailing
>More help   :
>

```
```# run Triaxial Test ***execfile('/media/disk/Doc_PhD/Triaxial_Yade/Triax_Python/Triax_01.py')

p=TriaxialTest()
p['rotationBlocked']=True # no particles rotation

p['lowerCorner']=Vector3(0,0,0)
p['upperCorner']=Vector3(12,12,12) # [mm]
p['numberOfGrains']=4000

p['sphereYoungModulus']=600.0 # [N/mm^2]
p['sphereKsDivKn']=0.6
p['sphereFrictionDeg']=26.57 # [degrees]

p['compactionFrictionDeg']=0.0 # [degrees]

p['boxYoungModulus']=600.0 # [N/mm^2]
p['boxKsDivKn']=0.6
p['boxFrictionDeg']=0.57 # [degrees]

p['density']=2.60e-6 # [kg/mm^3]

p['dampingForce']=0.0
p['dampingMomentum']=0.0

p['defaultDt']=-1

# sigma to get at the end of the expansion method
p['sigmaIsoCompaction']=0.05 # [N/mm^2]

# sigma for isotropic condition (before the triaxial)
p['sigmaLateralConfinement']=0.05 # [N/mm^2]

p['strainRate']=1.0 # [s^-1]
p['maxWallVelocity']=100.0 # [s^-1]

p['StabilityCriterion']=0.05

# expansion method parameters
p['internalCompaction']=True # flag for expansion method
p['maxMultiplier']=1.001
p['finalMaxMultiplier']=1.0001

p['wallOversizeFactor']=1.50

# PSD

o=Omega() # create an instance of Omega class
o.dt=.5*utils.PWaveTimeStep() # initial timestep
o.save('/tmp/a.xml.bz2') # save simulation

qt.Controller()
qt.View()

# ***************************************************
# function that perform the calculation of the maximum/minimum radius between spheres
# check also if the distribution is uniform among the range of radii
# type MaxMinRadius() in the console to run this function
o=Omega()
for b in o.bodies:
if b.shape.name=='Sphere':
else:

###
delta=(r_max-r_min)/10
import numpy as np
for i in np.arange(r_min+delta,r_max+delta,delta):
cout=0
r_prev=i-delta
for p in range(0,4000):
continue
print i, "  ", cout # interval (upper limit) and number of spheres

```