Page 6 - Demo
P. 6
Planar Truss Examplefor ComrelAdd-onRCPConsult, 2021-2025Page 6PlotS:=[seq(BarS[i],i=1..nfe),seq(AS[i],i=1..nfe),seq(mapC[i],i=1..nco),seq(mapL[i],i=1..2)]:endif# Plot frameRplt:=rectangle([-2,-1],[28,7],transparency=1,thickness=0.5):# Plot values of input dataA1p:=textplot([23.5,4.7,`#msup(mi(`||(sprintf(\||`),mi(2))`],align={above,right}):A2p:=textplot([23.5,4.4,`#msup(mi(`||(sprintf(\||`),mi(2))`],align={above,right}):E1p:=textplot([23.5,4.1,`#msup(mi(`||(sprintf(\||`),mi(2))`],align={above,right}):E2p:=textplot([23.5,3.8,`#msup(mi(`||(sprintf(\||`),mi(2))`],align={above,right}):# Plot a main title of plotifStrurelMode=0orStrurelMode=2thenT1p:=textplot([0.5,4.6,sprintf(\StrurelName,StrurelModule,StrurelVersion)],align={above,right},font=[\endififStrurelMode=0then:# input data at state of mean valuesT2pt:=\T3pt:=\elifStrurelMode=2then:# input data at beta-pointT2pt:=sprintf(\StrurelIMET,StrurelIOPT):T3pt:=sprintf(\StrurelBeta,StrurelPf):# calculated beta and PfendifT2p:=textplot([0.5,4.3,T2pt],align={above,right},font=[\T3p:=textplot([0.5,4.0,``||T3pt ||``],align={above,right},font=[\Tse:=textplot([0,-1,StrurelEngine],align={above,right},font=[\display(Rplt,PlotT,PlotS,A1p,A2p,E1p,E2p,T1p,T2p,T3p,Tse,scaling=constrained,axis=[thickness=0.5,gridlines=[color=lightblue]],title=tit,titlefont=[\endprocfornp to3doifStrurelPlotMode=1orStrurelPlotMode=3then# Complete maplet to display a created plotmapletS :=Maplet(Plotter('width'=getmetric(0)/2,'height'=getmetric(1)/2,'reference'='Plotter','value'=TrussPlot(np)),# plot function defined aboveBoxLayout('reference'='BoxLayout',BoxColumn(BoxCell('value'='Plotter'))),Window('layout'='BoxLayout','reference'='Window','resizable'='false','title'=tit),Action(RunWindow('window'='Window'))):# Show mapletMaplets[Display](mapletS):endififStrurelPlotMode=2orStrurelPlotMode=3then++StrurelPlotCount:Export(cat(StrurelPlotName,convert(StrurelPlotCount,string),StrurelPlotType),TrussPlot(np),width=getmetric(0)/2,height=getmetric(1)/2):endifenddoendifendif# end of plot block## Return value of script (proc)returna[8];# vertical deflection at bottom center (N04)endproc## Procedure to create \tocold\Jet:=proc(n)c:=Matrix(n,3,fill=1.):dv:=2/(n1):v:=-1;fori ton doifv <-0.5thenc[i,1]:=0.:c[i,2]:=4*(v+1.)/2.:elifv <0.thenc[i,1]:=0.:c[i,3]:=1.+4*(-0.5-v)/2:elifv <0.5thenc[i,1]:=4*v/2:c[i,3]:=0.:elsec[i,2]:=1.+4*(0.5v)/2:c[i,3]:=0:endifv:=v+dvenddoreturncend:In the script it is demonstrated how to create additional visualization from Maple. 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 Mapleengine.