Page 7 - Demo
P. 7


                                    Planar Truss Example for Comrel Add-on RCP Consult, 2023-2025 Page 7 * \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 if end if ier=0!! Return value of export function PlanarTruss=ac(8) ! vertical deflection u_y at bottom center (N04) end function subroutine MATNUL(x,m,n)!.....Zeroes matrix X(M,N) implicit real*8(a-h,o-z) dimension x(m*n) mn=m*n do i=1,mn x(i)=0. end do return end subroutine 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 do end do return end subroutine 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 do end do return end subroutine 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!.....Triangularization do 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 do end do!.....Resolution do 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 do return end
                                
   1   2   3   4   5   6   7   8   9   10   11