Page 5 - Demo
P. 5
Interface to Maple%uf09f%uf09fRCPConsult2020-2025Page 5For illustrated explanation how the Stochastic Model data of STRUREL have tobe used in communication with MapleInterface the following well known example will be taken (User Manual: Stone example):The assigned global nameswill have the very same names as in the Stochastic Model: Load, Strength, Diameter, PAR1, PAR2and corresponding values. Each global vectorwill have 5 elements with corresponding values as ordered above.6.Maple script fileThe scriptfilecontaining a Procedurewith a single input argument usually looks likeStrurelMaple:=proc(XP)# Usesonly vector notation to accessvalues ofVariables and Parameters.# The sequence in inputvector XP is predefined by Stochastic Model.returnXP[4]*Pi/4*XP[2]*XP[3]^2-XP[5]*XP[1];endproc;Here elements of input vector %u2019XP%u2019containing values from global vectorv_XP_can be accessed directly by an index, as is ordered in Stochastic Model of STRUREL.Alternatively, the assignedglobal variablesmay be used also inside of functionStrurelMaple:=proc(XP)# Uses global names of Variables and Parameters to access their values.# The sequence is arbitrary. Both STRUREL and Maple are case sensitive.# Random Variables:globalLoad;globalStrength;globalDiameter;# Parameters:globalPAR1;globalPAR2;returnPAR1*Pi/4*Strength*Diameter^2-PAR2*Load;endproc;Direct notation of both global vectorsis also applicableStrurelMaple:=proc(XP)# Global vector notation to access values of Variables and Parameters.# The sequence in global vector v_XP_ is predefined by Stochastic Model.returnv_XP_[4]*Pi/4*v_XP_[2]*v_XP_[3]^2-v_XP_[5]*v_XP_[1];endproc;It is permitted to use a mixed mode %u2013global vectors, global namesand arguments in the same function.