Page 5 - Demo
P. 5


                                    Planar TrussExamplefor ComrelAdd-onRCPConsult, 2022-2025Page 5// set a main subtitle of plotxstring(8.0,8.0,'$Internal\\,member\\,forces\\,[N]
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

);gce().font_size=5;plot(XY(:,1),XY(:,2),'k+');// plot internal member force Nfore =1:nfel=leng(e)/2;n=abs(N(e))*0.0000005;X=[-l l l -l];Y=[-n -n n n];c =cos(theta(e));s =sin(theta(e));Xrot =X*c Y*s;Yrot =X*s +Y*c;x=(XY(IEN(e,1),1)+XY(IEN(e,2),1))/2;y=(XY(IEN(e,1),2)+XY(IEN(e,2),2))/2;if(N(e)>=0)co=color(255,155,127);elseco=color(127,155,255);endxfpoly(Xrot +x,Yrot +y,co);str=sprintf('$%0.1f\\\\,N
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

,N(e));rect=stringbox(str,x,y);xstring(x(rect(1,3)rect(1,1))/2,y(rect(2,2)rect(2,1))/2,str);gce()font_size=2;endcase3// plot for internal member tensile stress sigma_uscf(nf);figure(nf,'Name',tit,'position',[pxl(3)/4pxl(4)/4pxl(3)/2pxl(4)/2]);// plot framereplot([222610]);mtlb_axis('equal');xgrid(2);// set a main subtitle of plotxstring(5.5,8.0,'$Internal\\,member\\,von\\,Mises\\,stress\\,\\sigma_v\\,[MPa]
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

);gce().font_size=5;plot(XY(:,1),XY(:,2),'k+');// plot for internal member von Mises stressminA=min(abs([N]'./Area*1e-6));maxA=max(abs([N]'./Area*1e-6));ddA=maxA-minA;dA=ddA/20;// Color barcmap=jetcolormap(21);// prepare color mappinggcf().color_map=cmap;colorbar(minA,maxA);fore =1:nfeSu=abs(N(e)/Area(e)*1e6);l=leng(e)/2;n=Su/ddA*0.2;// height of rectangleX=[-l l l -l];Y=[n n n n];c =cos(theta(e));s =sin(theta(e));Xrot =X*c -Y*s;Yrot =X*s +Y*c;x=(XY(IEN(e,1),1)+XY(IEN(e,2),1))/2;y=(XY(IEN(e,1),2)+XY(IEN(e,2),2))/2;nc=int32((SuminA)/dA0.01)+1;co=color(int(cmap(nc,1)*255),int(cmap(nc,2)*255),int(cmap(nc,3)*255));// colorxfpoly(Xrot +x,Yrot +y,co);str=sprintf('$%0.0f
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

,Su);rect=stringbox(str,x,y);xstring(x(rect(1,3)rect(1,1))/2,y(rect(2,2)rect(2,1))/2,str);gce()font_size=2;endend// do rest for all plotsxtitle(tit);gce().title.font_size=6;// plot values of input dataxstring(22,6.5,sprintf('$A1=%g\\\\,m^2
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

,A1));gce()font_size=3;xstring(22,6.1,sprintf('$A2=%g\\\\,m^2
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

,A2));gce()font_size=3;xstring(22,5.7,sprintf('$E1=%g\\\\,N/m^2
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

,E1));gce().font_size=3;xstring(22,5.3,sprintf('$E2=%g\\\\,N/m^2
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

,E2));gce().font_size=3;// plot a main title of plotxstring(1.0,6.5,sprintf('%s %s %s',StrurelName,StrurelModule,StrurelVersion));gce().font_size=4;selectStrurelModecaseint32(0)xstring(-1.0,6.0,'State at Mean Values');gce().font_size=3;caseint32(2)xstring(-1.0,6.0,sprintf('%s, %s',StrurelIMET,StrurelIOPT));gce()font_size=3;xstring(1.0,5.5,sprintf('$beta=%g,\\\\,Pf=%g
   1   2   3   4   5   6   7   8   9   10

 

 

 

 

 

,StrurelBeta,StrurelPf));gce().font_size=3;// calculated beta and Pfendxstring(1.9,1.8,StrurelEngine);gce().font_size=2;gce()alignment='center'// invoked version of engineif(StrurelPlotMode==2||StrurelPlotMode==3)thenStrurelPlotCount=StrurelPlotCount+1xs2png(nf,StrurelPlotName+string(StrurelPlotCount)+StrurelPlotType)if(StrurelPlotMode==2)thencloseendendendendend// begin of plot blockendfunction// end of function
   1   2   3   4   5   6   7   8   9   10