Page 7 - Demo
P. 7
Planar Truss Examplefor ComrelAdd-onRCPConsult, 2023-2025Page 7*\'' at 22.,4.6 font ''Arial,10''')\E2callGnuplotPut(nf,trim(buffer)//c_)! Invoked versions of gnuplot and enginewrite(buffer,\1.9,9.7 \*\ font ''Arial,8''')\trim(GnuplotVersion)callGnuplotPut(nf,trim(buffer)//c_)write(buffer,\1.9,1.7 \*\ font ''Arial,8''')\trim(StrurelEngine)callGnuplotPut(nf,trim(buffer)//c_)! Show/Export a plotif(StrurelPlotMode.eq.1.or.StrurelPlotMode.eq.3)thencallGnuplotShow(nf)endifif(StrurelPlotMode.eq.2.or.StrurelPlotMode.eq.3)thenStrurelPlotCount=StrurelPlotCount+1write(buffer,\*trim(StrurelPlotName),StrurelPlotCount,trim(StrurelPlotType)callGnuplotExport(nf,trim(buffer)//c_)endifcallGnuplotEnd()endifenddoendifendifier=0!! Return value of export functionPlanarTruss=ac(8)! vertical deflection u_y at bottom center (N04)endfunctionsubroutineMATNUL(x,m,n)!.....Zeroes matrix X(M,N)implicitreal*8(ah,oz)dimensionx(m*n)mn=m*ndoi=1,mnx(i)=0.enddoreturnendsubroutineMATRAN(a,b,m,n)!.....Transposes a matrix A(M,N).!.....Result will be stored in matrix B(N,M)!.....Calling: dimension a(m,n),b(n,m)!..... call MATRAN(a,b,m,n)implicitreal*8(a-h,o-z)dimensiona(m,n),b(n,m)doj=1,ndoi=1,mb(j,i)=a(i,j)enddoenddoreturnendsubroutineMATMLT(a,b,c,m,n,l)!.....Multiplies the matrixes A(M,N) and B(N,L)!.....Result will be stored in matrix C(M,L).!.....Calling: dimension a(m,n),b(n,l),c(m,l)!..... call MATMLT(a,b,c,m,n,l)implicitreal*8(a-h,o-z)dimensiona(m,n),b(n,l),c(m,l)dok=1,ldoi=1,md=0.doj=1,nd=d+a(i,j)*b(j,k)enddoc(i,k)=denddoenddoreturnendsubroutineLINSOL(a,b,c,m)!.....Solves a system of linear equations A*B=C!.....Result will be stored in vector B(M).!.....Calling: dimension a(m,m),b(m),c(m)!..... call LINSOL(a,b,c,m)implicitreal*8(a-h,o-z)dimensiona(m,m),b(m),c(m)!.....https://stackoverflow.com/questions/37701747/programtosolveasystemoflinearequationsinc!.....Triangularizationdoi=1,m-1dok=i+1,mt=a(k,i)/a(i,i)doj=1,ma(k,j)=a(k,j)-t*a(i,j)enddoc(k)=c(k)-t*c(i)enddoenddo!.....Resolutiondoi=m,1,1b(i)=c(i)doj=m,i+1,1b(i)=b(i)-a(i,j)*b(j)enddob(i)=b(i)/a(i,i)enddoreturnend