6. Examples#

# This example is only intended to give an idea of the syntax and

# useful associated operators (for retrieving functions)

# generated and their possible verification).

# The interspectrum used has no meaning. There is no step

# of use of generated functions (with a dyna_tran_modal by

# example).

# The zzzz180a and sdll107a test cases provide more comprehensive examples


# Definition of interspectrum

spect11 = DEFI_FONCTION (

NOM_PARA = “FREQ”, VALE_C = ( 0. , 10. , 0. , 50.0, 10. , 0. , 150. , 0.1, 0. , ) )

spect12 = DEFI_FONCTION (

NOM_PARA = “FREQ”, VALE_C = ( 0. , 0.5, 0.8, 150. , 0.5, 0.8, ) )

spect22 = DEFI_FONCTION (

NOM_PARA = “FREQ” VALE_C = ( 0. , 1. , 0. , 150. , 1.. , 0. , ) )

mat_int = DEFI_INTE_SPEC (

DIMENSION = 2, PAR_FONCTION = (_F (NUME_ORDRE_I = 1, NUME_ORDRE_J = 1, FONCTION = sp11), _F (NUME_ORDRE_I = 1, NUME_ORDRE_J = 2, FONCTION = sp12), _F (NUME_ORDRE_I = 2, NUME_ORDRE_J = 2, FONCTION = sp22) ) )

# Generation of the two time functions via the data structure

# interspectrum

vect = GENE_FONC_ALEA (INTE_SPEC = mat_int,

DUREE_TIRAGE = 5. , NB_TIRAGE = 10, )

# Retrieving the two functions for example for a IMPR_FONCTION

FONC1 = RECU_FONCTION (INTE_SPEC = vect,

NUME_ORDRE = 1)

FONC2 = RECU_FONCTION (INTE_SPEC = VECT1,

NUME_ORDRE = 2)

# Verification: Calculation of the interspectrum of the generated functions

# Warning: the value given to NB_POIN is important. He is

# desirable to take it equal to the number of points constituting

# the functions (2*nb_fft if coming from GENE_FONC_ALEA).

INTERS = CALC_INTE_SPEC (INST_INIT =0. ,

INST_FIN =50. , DUREE_ANALYSE =5. , DUREE_DECALAGE =5. , NB_POIN =2048, FONCTION =( FONC1, FONC2,))

# Retrieving the auto-spectrum of FONC1 for comparison to spetc11

F11 = RECU_FONCTION (INTE_SPEC = INTERS,

NUME_ORDRE_I =1, )