Code_Aster
®
Version
7.4
Titrate:
Operator
GENE_VARI_ALEA
Date:
08/02/05
Author (S):
S. CAMBIER, C. DESCELIERS
Key
:
U4.36.07-B
Page
:
1/6
Instruction manual
U4.3- booklet: Function
HT-66/05/004/A
Organization (S):
EDF-R & D/AMA
Instruction manual
U4.3- booklet: Function
Document: U4.36.07
Operator GENE_VARI_ALEA
1 Goal
To generate a realization of a real random variable of law of probability given (laws gamma or
exponential exits of the application of the maximum of entropy, [R4.03.05]).
Product a structure of data counts.
Code_Aster
®
Version
7.4
Titrate:
Operator
GENE_VARI_ALEA
Date:
08/02/05
Author (S):
S. CAMBIER, C. DESCELIERS
Key
:
U4.36.07-B
Page
:
2/6
Instruction manual
U4.3- booklet: Function
HT-66/05/004/A
2 Syntax
[table]
= GENE_VARI_ALEA
(
/STANDARD =
“GAMMA” [DEFECT]
VALE_MOY
=
/
vale_moy
[R]
/
1.0
[DEFECT]
BORNE_INF
=
/
has
[R]
/
0.
[DEFECT]
COEF_VAR
=
/
delta
[R]
/0.1
[DEFECT
/STANDARD =
“EXPONENTIAL”
VALE_MOY
=
/
vale_moy
[R]
/
0.
[DEFECT]
BORNE_INF
=
/
has
[R]
/
- 1.0 [DEFECT]
/STANDARD =
“EXP_TRONQUEE”
VALE_MOY
=
/
vale_moy
[R]
/
0.
[DEFECT]
BORNE_INF
=
/
has
[R]
/
- 1.0 [DEFECT]
BORNE_SUP
=
/
B
[R]
/1.0 [DEFECT]
INIT_ALEA
=
nor
[I]
);
Code_Aster
®
Version
7.4
Titrate:
Operator
GENE_VARI_ALEA
Date:
08/02/05
Author (S):
S. CAMBIER, C. DESCELIERS
Key
:
U4.36.07-B
Page
:
3/6
Instruction manual
U4.3- booklet: Function
HT-66/05/004/A
3 Operands
3.1 Word
keys
TYPE
According to information usable on the random variable to simulate, three types of law of probability are
available. If information available is a support not limited
[
,
[
+
has
, an average
W
, and one
scatter coefficient
, the law is gamma. If information available is a support not limited
[
,
[
+
has
and an average
W
, the law is exponential. If information available is a support
compact
]
,
[B
has
and an average
W
, the law is exponential truncated.
/STANDARD = “GAMMA” [DEFECT]
The random variable follows a law of probability of the type “gamma” of which distribution of
probability
()
dw
P
W
is defined by
:
()
[
]
()
(
)
(
)
(
)
,
W
exp
1
I
2
1
2
1
2
2
,
2
2
2
dw
has
W
has
has
W
has
W
W
dw
P
has
W
-
-
-
-
-
=
-
-
+
with
()
+
-
-
=
0
1
dt
E
T
Z
T
Z
.
/STANDARD = “EXPONENTIAL”
The random variable follows a law of “exponential” probability of the type of which distribution of
probability
()
dw
P
W
is defined by
:
()
[
]
()
,
W
exp
1
I
,
dw
has
W
has
has
W
W
dw
P
has
W
-
-
-
-
=
+
with
[
[
()
[
[
[
[
()
[
[
+
=
+
=
+
+
,
0
I
,
1
I
,
,
has
W
W
has
W
W
has
has
if
and
if
.
/STANDARD = “EXP_TRONQUEE”
The random variable follows a law of exponential probability of the type “truncated” of which
probability distribution
()
dw
P
W
is defined by:
()
[]
() ()
dw
E
K
K
W
dw
P
kw
B
has
W
-
=
,
I
,
with
[]
()
[]
[]
()
[]
B
has
W
W
B
has
W
W
B
has
B
has
,
0
I
,
1
I
,
,
=
=
if
and
if
and where
K
is such as
(
) ()
()
0
1
=
-
-
K
K
K
K
W
, with
()
K
ak
E
E
B
K
-
=
-
and
()
K
ak
E
E
B
B
has
K
-
=
-
.
3.2 Word
key
VALE_MOY
VALE_MOY =/
W
[R]
/
0.
or
1.0
[DEFECT]
Indicate the average value of the random variable to simulate.
Code_Aster
®
Version
7.4
Titrate:
Operator
GENE_VARI_ALEA
Date:
08/02/05
Author (S):
S. CAMBIER, C. DESCELIERS
Key
:
U4.36.07-B
Page
:
4/6
Instruction manual
U4.3- booklet: Function
HT-66/05/004/A
3.3 Word
key
COEF_VAR
COEF_VAR ² =/
/
0.1
[DEFECT]
This key word informs the scatter coefficient (standard deviation report/ratio about absolute value of
average). The value taken by defect is 0.1.
3.4 Words
key
BORNE_INF AND BORNE_SUP
BORNE_INF
=
/
has
[R]
/
1.0
or
0.
[DEFECT]
BORNE_SUP
=
/
B
[R]
/- 1.0 or 0.
[DEFECT]
These key words inform the lower limit and the upper limit (when they exist)
support
[,]
B has
or
[,
[
has
+
laws.
3.5 Operand
INIT_ALEA
INIT_ALEA
=
nor
[I]
Cause initialization with sound
nor
ième term of the continuation of pseudo-random numbers used
for the generation of the variables.
If the key word
INIT_ALEA
misses, the terms used of the continuation are those immediately
consecutive with those already used. If no term were still used, the continuation is initialized with sound
first term.
Suggestion:
With less than one particular use, it is advised not to inform the key word
INIT_ALEA
in the operators according to: GENE_FONC_ALEA, GENE_VARI_ALEA and GENE_MATR_ALEA.
In this case, with the first call to the one of these operators, the continuation of pseudo numbers
random is initialized in its first term. The omission of the key word
INIT_ALEA
with each one
calls of these operators in the command file guarantees independence
statistics of the pseudo-random numbers used.
Note:
The germ of the continuation remains identical of one execution to the other of Code_Aster; results
thus remain rigorously identical (one can thus test nonthe regression of results
statistics not converged). If one wishes to generate results statistically
independent from one execution to another, then the key word should be used
INIT_ALEA
with
values raising the number of terms used in the former executions.
Caution:
The generator of random variable used is that of the module “random” of Python. It
depends on the version of Python exploited by Code_Aster. Not converged results
statistically can thus vary from one version to another of Code_Aster or a punt
form with the other, if the version of Python is not the same one and that between the two versions it
modulate random evolved/moved (case between Python 2.1 and 2.3).
Note:
In version Python 2.3, the period of the generator is 2 ** 19937-1 [bib1].
Code_Aster
®
Version
7.4
Titrate:
Operator
GENE_VARI_ALEA
Date:
08/02/05
Author (S):
S. CAMBIER, C. DESCELIERS
Key
:
U4.36.07-B
Page
:
5/6
Instruction manual
U4.3- booklet: Function
HT-66/05/004/A
4 Example
By call, the control generates only one realization of the random variable to simulate. For
to generate several achievements of the same random variable, it is necessary to repeat the control without
to change its parameters or to place the control in a loop of the process control language of
Code_Aster - the language Python. Each realization is statistically independent of the others
achievements.
In the following example, one generates NS achievements of a random variable gamma of average value
25000, of support and scatter coefficient 0.1 positive realities. These achievements are then
used as values of stiffness of shock.
ns=100
for K in arranges (1, ns+1):
# Generation
KN =GENE_VARI_ALEA (TYPE=' GAMMA',
BORNE_INF =0.,
VALE_MOY =25000.,
COEF_VAR =0.1,
)
# Extraction of the value in the produced table
VKN = KN [“NO.”, 1]
DYN=DYNA_TRAN_MODAL (
…
CHOC=_F (
…
RIGI_NOR = VKN,
…
)
)
# Here for example, statistical processing of DYN
TO DESTROY (CONCEPT=_F (NOM= (DYN, KN)))
# End of the loop (indentation)
For more complete examples, to consult [U2.08.05] or the case test SDNS01 [V5.06.001].
Code_Aster
®
Version
7.4
Titrate:
Operator
GENE_VARI_ALEA
Date:
08/02/05
Author (S):
S. CAMBIER, C. DESCELIERS
Key
:
U4.36.07-B
Page
:
6/6
Instruction manual
U4.3- booklet: Function
HT-66/05/004/A
5 Bibliography
[1]
Mr. Matsumoto and T. Nishimura, Mersenne Twister: With 623-dimensionally equidistributed
uniform pseudorandom number generator, ACM Transactions one Modeling and Computer
Simulation vol. 8, No 1, January pp.3-30 1998.