Page 6 - Demo
P. 6


                                    Planar Truss Examplefor ComrelAdd-onRCPConsult, 2021-2025Page 6% Plot values of input datatext(22,5.5,sprintf('A1=%g m^2',A1),'FontSize',8);text(22,5.2,sprintf('A2=%g m^2',A2),'FontSize',8);text(22,4.9,sprintf('E1=%g N/m^2',E1),'FontSize',8);text(22,4.6,sprintf('E2=%g N/m^2',E2),'FontSize',8);% Plot a main subtitle of plottext(1.0,5.5,sprintf('%s %s %s',StrurelName,StrurelModule,StrurelVersion),'FontSize',12);switch(StrurelMode)case0text(1.0,5.0,'State at Mean Values','FontSize',10);% input data at state of mean valuescase2text(1.0,5.0,sprintf('%s, %s',StrurelIMET,StrurelIOPT),'FontSize',10);% input data at betapointendswitch(StrurelMode)case2%% Stochastic Solutiontext(-1.0,4.5,sprintf('beta=%g, Pf=%g',StrurelBeta,StrurelPf),'FontSize',10);% calculated beta and Pfendtext(-1.9,-1.8,StrurelEngine,'FontSize',8);% invoked version of engine% Show/Export a plot% https://de.mathworks.com/matlabcentral/answers/446458howcanihandlevisibilityonoffforplotfunctionswitch(StrurelPlotMode)case{1,3}ff(f).Visible='on';case2ff(f).Visible='off';end% https://de.mathworks.com/help/matlab/ref/saveas.htmlswitch(StrurelPlotMode)case{2,3}StrurelPlotCount=StrurelPlotCount+1;saveas(ff(f),sprintf('%s%d%s',StrurelPlotName,StrurelPlotCount,StrurelPlotType));endendendend% end of plot blockend% end of functionIn the script it is demonstrated how to create additional visualization from Matlab. The specific plots for two states, the Deterministic Solution (with Stochastic Variables at mean values) and the Stochastic Solution (with Stochastic Variables at values at the %u00df-point), can be produced using built-in facilities of Matlabengine.You can use special Information Variablesof STRUREL:StrurelMode0 %u2013initial state before evaluation having global vector state as mean values1 intermediate state of global vector during evaluation2 %u2013final state after evaluation having global vector state at %u00df-pointStrurelRunInteger counter of calls of state functionStrurelNameLiteral value %u2018STRUREL%u2019StrurelModuleLiteral value %u2018COMRELTI%u2019 or %u2018COMRELTV%u2019 or %u2018SYSREL%u2019 or %u2018COSTREL%u2019StrurelVersionLiteral value %u20182025%u2019 or corresponding value for future versionsStrurelIMETLiteral value with description of method of probaility integrationStrurelIOPTLiteral value with description of optimizer for %u00df-point searchStrurelBetaReal value of reliability index %u00dfStrurelPfReal value of failure probability PfStrurelEngineLiteral value with information about version of interface engineStrurelPlotLogical variable to switch on/off postprocessing facilitiesStrurelPlotNameLiteral value for a base name of file for plot drawn in interface engineStrurelPlotTypeLiteral value for an extension of file for plot drawn in interface engineStrurelPlotMode1 %u2013shows a generated plot in aseparate window2 %u2013saves a generated plot in a file with format defined by an plot extension3 combines mode 1 and mode 2StrurelPlotCountInteger counter of plots drawn on run. Default is 0
                                
   1   2   3   4   5   6   7   8   9   10