Page 5 - Demo
P. 5
Interface to Maple%uf09f %uf09f RCP Consult 2020-2026 Page 5For illustrated explanation how the Stochastic Model data of STRUREL have to be used in communication with Maple Interface the following well known example will be taken (User Manual: Stone example):The assigned global names will have the very same names as in the Stochastic Model: Load, Strength, Diameter, PAR1, PAR2 and corresponding values. Each global vector will have 5 elements with corresponding values as ordered above.6. Maple script fileThe script file containing a Procedure with a single input argument usually looks likeStrurelMaple := proc(XP)# Uses only vector notation to access values of Variables and Parameters.# The sequence in input vector XP is predefined by Stochastic Model.return XP[4]*Pi/4*XP[2]*XP[3]^2-XP[5]*XP[1];end proc;Here elements of input vector %u2019XP%u2019 containing values from global vector v_XP_ can be accessed directly by an index, as is ordered in Stochastic Model of STRUREL.Alternatively, the assigned global variables may 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:global Load;global Strength;global Diameter;# Parameters:global PAR1;global PAR2;return PAR1*Pi/4*Strength*Diameter^2-PAR2*Load;end proc;Direct notation of both global vectors is 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.return v_XP_[4]*Pi/4*v_XP_[2]*v_XP_[3]^2-v_XP_[5]*v_XP_[1];end proc;It is permitted to use a mixed mode %u2013 global vectors, global names and arguments in the same function.

