Examples ======== Calculation of an envelope ---------------------- The following command file: DEPI =2. * pi PAS0 = DEPI/200. LI1 = DEFI_LIST_REEL (DEBUT =0. , INTERVALLE =_F (JUSQU_A = DEPI, PAS = PAS0)) COa = FORMULE (NOM_PARA =' INST ', VALE ='cos (INST)') SIa = FORMULE (NOM_PARA =' INST ', VALE ='sin (INST)') CO = CALC_FONC_INTERP (FONCTION = COa, LIST_PARA = LI1, NOM_PARA =' INST ', NOM_RESU =' DEPL ', PROL_GAUCHE =' EXCLU ', PROL_DROITE =' LINEAIRE', INTERPOL =' LIN ', TITRE =' FONCTION COSINUS ') IF = CALC_FONC_INTERP (FONCTION = SIa, LIST_PARA = LI1, NOM_PARA =' INST ', NOM_RESU =' DEPLACEMENT ', PROL_GAUCHE =' EXCLU ', PROL_DROITE =' CONSTANT ', INTERPOL =' LIN ', TITRE =' FONCTION SINUS ') .. code-block:: text ENV1 = CALC_FONCTION (ENVELOPPE =_F (FONCTION = (SI, CO,),), CRITERE = 'SUP')) Calculating the derivative of the function si -------------------------------------- The commands that follow .. code-block:: text der1 = CALC_FONCTION (DERIVE =_F (FONCTION = yes),) .. code-block:: text inst1 = 20. * step .. code-block:: text TEST_FONCTION (VALEUR = _F (FONCTION = der1, NOM_PARA = 'inst', VALE_PARA = inst1, VALE_REFE = COa (inst1),) ) produce on the file 'RESULTAT': .. code-block:: text ---- FONCTION: DER1 OK INST RELA -0.016% VALE: 8.0888392298046D-01 6.28319E-01 TOLE 0.100% REFE: 8.0901699437495D-01 Concatenation of two functions ------------------------------- .. code-block:: text DFC1 = DEFI_FONCTION (NOM_PARA ='X', NOM_RESU ='Y', VALE =( 0., 10. , 4., 14. , 6., 16.,), PROL_DROITE =' LINEAIRE ', PROL_GAUCHE =' LINEAIRE ' ) # DFC2 = DEFI_FONCTION (NOM_PARA ='X', NOM_RESU ='Y', VALE =( 5., 25. , 7., 27. , 8., 28.,), PROL_DROITE =' LINEAIRE ', PROL_GAUCHE =' LINEAIRE ' ) # DFC3 = CALC_FONCTION (ASSE =_F ( FONCTION = (DFC2, DFC1,), SURCHARGE = 'DROITE') ) DFC4 = CALC_FONCTION (ASSE =_F ( FONCTION = (DFC1, DFC2,), SURCHARGE = 'GAUCHE') ) The values of the dfc3 function are: .. code-block:: text x = 0. 4. 5. 5. 7. 8. y = 10. 14. 25. 25. 27. 28. The values of the dfc4 function are: .. code-block:: text x = 0. 4. 6. 6. 7. 8. y = 10. 14. 16. 16. 27. 28. Composition of two functions ----------------------------- .. code-block:: text funk1 = DEFI_FONCTION (NOM_PARA = 'X', NOM_RESU = 'F', VALE = (0., 0. , 2., 5. , 3., 10. , 5., 15. , 7., 13. , 8., 10. , 10., 9. , 12., 8. , 13., 5. , 15., 1. , 20., 0.))) .. code-block:: text funk2 = DEFI_FONCTION (NOM_PARA = 'INST', NOM_RESU = 'X', VALE = (0., 0. , 0.1, 2. , 0.2, 4. , 0.3, 6. , 0.4, 8. , 0.5, 10. , 0.6, 12. , 0.7, 14. , 0.8, 16. , 0.9, 18. , 1.0, 20.)) .. code-block:: text comp1 = CALC_FONCTION (COMPOSE = _F (FONC_RESU = func1, FONC_PARA = background2) ) The values of the comp1 function are: .. code-block:: text inst = 0.0.1 0.2 0.3 0.4 0.4 0.5 0.6 0.7 0.8 0.9 1.0 F = 0. 5. 12.5 14. 10. 9. 8. 8. 3. 0.8 0.4 0.