Page 5 - Demo
P. 5
Interface to Mathematica%uf09f%uf09fRCPConsult2020-2025Page 5The assigned global vectors, global namesand information variables can be explicitly used in any script or expression.For illustrated explanation how theStochastic Model data of STRURELmust be used in communication with theMathematicaInterfacethe 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.Mathematicascript fileThe Functionused in STRURELis a little bit complex due to usage of Module.The scriptfilecontaining a functionwith a single input argument usually looks likeStrurelMathematica[XP_]:=Module[{},(*Uses only vector notation to access values of Variables and Parameters.The sequence in input vector XP is predefined by Stochastic Model.*)XP[[4]]*Pi/4*XP[[2]]*XP[[3]]^2-XP[[5]]*XP[[1]]];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 assigned global variablesmay be used also inside of functionStrurelMathematica[XP_]:=Module[{},(*Uses global names of Variables and Parameters to access their values.The sequence is arbitrary. Both STRUREL and Mathematica are case sensitive.*)PAR1*Pi/4*Strength*Diameter^2-PAR2*Load];