! Solve for tension in support straps ! by doing static force balance ! [e]*{T} = {0 0 W}^T ! where e contains the direction cosines (unit vectors) of straps ! ie sum of forces in x&y are 0., sum in z equals weight use nag_mat_inv character*16 arg real*8, dimension(3,10) :: pts ! first six points are for laser, 7 is CG, 8,9,10 are straps real*8, dimension(3,3) :: e ! coef matrix iarg=iargc() if(iarg.lt.1)stop " usage: tension.x zhook" narg = getarg(1,arg) read(arg,*) zhook do read(*,*,iostat=istat) pts pts(3,7)=zhook if(istat.ne.0)exit do i=1,3 do k=1,3 e(k,i)=pts(k,7)-pts(k,i+7) enddo e(:,i)=e(:,i)/sqrt(dot_product(e(:,i),e(:,i))) enddo call nag_gen_mat_inv(e) write(*,"(3f12.6)") e(:,3) enddo stop end