Page 4 - Demo
P. 4
Interface to R%uf09f%uf09fRCPConsult2021-2025Page 44.The interaction between STRURELand RThe major kind of communication with a RInterface is usage of script fileswith extension %u2019.r%u2019. Two types of scripts are implemented.The first typeof script describes a real functionwith a single argument as a vector containing mean values of all stochastic variables and fixed values of all deterministic parameters, as is ordered in Stochastic Model of STRUREL. If the functionis run from the GUI for testing and debugging the stochastic variables are set to the mean values. The return value of this functionis a partialor complete evaluation of theState Function in Symbolic Expression of STRURELjob.The second type of script may contain any set of commands in notation of Rlanguage. Such a script must have a statement defining variable %u2019res%u2019 as a final return value. Usually, this statement is the last one. We recommend using thefirst type of script, because a description of functionwill be loaded and parsed by engine once. Then, on runtime, it will be just evaluated numerically. The second kind of script requires loading and parsing of its content by the engine runtime for each call of evaluation. This slows down computation.Additionally, it is possible to send a single statement or an expression with multiple statements direct into the engine for a numerical evaluation or intermediate processing for evaluation of the state function.5.Global Data in the InterfaceBefore processing interface data in form of script files or direct expressions STRUREL presets all required input variables. Three global sets will be defined: two global vectorsand additionally, each stochastic variable and deterministic parameter become an assigned global namehaving exactly the same name as in the Stochastic Model. This allows to work in vector notation and/or direct over global names. The first global vectorhas a fixed name s_XP_and contains the mean values for the stochastic X-variables followed by the values of the deterministic Parameters. The second global vectorhas a fixed name v_XP_and receives all values of the current evaluation step for the X-variables followed again by the values of the deterministic Parameters.Implementation of global vectors s_XP_and v_XP_allows creation of plots of the initial and final (%uf062-point) states of a structure where a comparison can be shown graphically and numerically.Finally, for special purposes, the following set of STRUREL information variableswill be also defined