Page 11 - Demo
P. 11
Planar Truss Example for Comrel Add-on RCP Consult, 2023-2025 Page 11 XYten(3,i)=Sv end do! Need to be closed XYten(1,nbd+1)=XYten(1,1) XYten(2,nbd+1)=XYten(2,1) XYten(3,nbd+1)=XYten(3,1) call GnuplotPlotData(nf,\_, & XYten,ned+1,nbd+1) write(buffer,\& int(Sv+0.1),xc,yc; call GnuplotPut(nf, trim(buffer)//c_) end do end select! Plot values of input data write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\E1 call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\E2 call GnuplotPut(nf,trim(buffer)//c_)! Invoked versions of gnuplot and engine write(buffer,\trim(GnuplotVersion) call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\trim(StrurelEngine) call GnuplotPut(nf,trim(buffer)//c_)! Show a plot call GnuplotShow(nf) call GnuplotEnd() end if end do end ifend ifier=0!! Return value of export functionPlanarTruss=ac(8) ! vertical deflection u_y at bottom center (N04) end functionsubroutine MATNUL(x,m,n)!.....Zeroes matrix X(M,N)implicit real*8(a-h,o-z)dimension x(m*n)mn=m*ndo i=1,mn x(i)=0.end doreturnendsubroutine MATRAN(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)implicit real*8(a-h,o-z)dimension a(m,n),b(n,m)do j=1,n do i=1,m b(j,i)=a(i,j) end doend doreturnendsubroutine MATMLT(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)implicit real*8(a-h,o-z)dimension a(m,n),b(n,l),c(m,l)do k=1,l do i=1,m d=0. do j=1,n d=d+a(i,j)*b(j,k) end do c(i,k)=d end doend doreturnendsubroutine LINSOL(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)implicit real*8(a-h,o-z)dimension a(m,m),b(m),c(m)!.....https://stackoverflow.com/questions/37701747/program-to-solve-a-system-of-linear-equations-in-c!.....Triangularizationdo i=1,m-1 do k=i+1,m t=a(k,i)/a(i,i) do j=1,m a(k,j)=a(k,j)-t*a(i,j) end do c(k)=c(k)-t*c(i) end doend do!.....Resolutiondo i=m,1,-1 b(i)=c(i) do j=m,i+1,-1 b(i)=b(i)-a(i,j)*b(j) end do b(i)=b(i)/a(i,i)end doreturnend