CALCS PROC057
VECTOR ANALYSIS

NOTATION

a11 to a33elements of coordinate transformation matrix
lx mx nxdirection cosines of x axis from X Y Z axes
ly my nydirection cosines of y axis
lz mz nzdirection cosines of z axis
Llength, between points
N1 2 3 i nnodes, 1st 2nd 3rd intermediate & last
NOnode defining origin O of local coordinate system
NAnode defining x axis thru OA
NBnode defining y axis (y normal to x if NC=0, on plane inc.NB)
NCnode defining z axis (z normal to x & y if NC=0)
Vvector, general, global system
vvector, general, local system
X Y Zcoordinates, global system
x y zcoordinates, local system

APPLICATION

transformation of coordinates, force equalibrium

OUTPUT

vector transformed to local axes

SEE ALSO

BAS002, PROC058

THEORY

057 3rd order matrix inversion
057B vector subtraction
057C vector transformation
057D cosine rule

GUIDANCE

Global coordinates must be defined as elements of X Y & Z arrays, local coordinates are output as elements of x y & z arrays. PROC057A & 057C call the transformation matrix determined by 057. The difference being 057A is arranged to apply the transformation to the list of nodes N1 to Nn while 057C applies it to a single vector. The transformed axes are orthoginal if NC=0 while they may be in any three unique directions if NC>0.

INPUT FORMAT

LET NO=:NA=:NB=:NC=:PROC057
LET N1=:Nn=:PROC057A
LET N1=:N2=:PROC057B
LET VX=:VY=:VZ=:PROC057C
LET N1=NC:N2=NB:N3=:La=:Lb=:Lc=:PROC057D

EXAMPLE

Call Statement

PRINT"DIMENSIONS, GLOBAL COORDS,"
LET X(1)=506:Y(1)=600:Z(1)=0
LET X(2)=274:Y(2)=600:Z(2)=0
LET X(3)=222:Y(3)=560:Z(3)=0
LET X(4)=-21:Y(4)=354:Z(4)=0
LET X(5)=-29:Y(5)=290:Z(5)=0
LET X(6)=-51:Y(6)=26:Z(6)=0
LET X(7)=-665:Y(7)=-61:Z(7)=-112
LET NA=O:NA=5:NB=3:NC=0:PROC057
LET N1=1:Nn=7:PROC057A
LET N1=NA:N2=NO:PROC057B
LET VX=-2.3*9.81:VY=9.4*9.81:VZ=4*9.81:PROC057C
LET N1=NA:N2=NB:N3=NO:La=FNl(N2,N3):Lb=FNl(N1,N3):Lc=FNl(N1,N2):PROC057D

Output

PROC057,DIMENSIONS, GLOBAL COORDS,
LET X(1)=506:Y(1)=600:Z(1)=0
LET X(2)=274:Y(2)=600:Z(2)=0
LET X(3)=222:Y(3)=560:Z(3)=0
LET X(4)=-21:Y(4)=354:Z(4)=0
LET X(5)=-29:Y(5)=290:Z(5)=0
LET X(6)=-51:Y(6)=26:Z(6)=0
LET X(7)=-665:Y(7)=-61:Z(7)=-112
LET NO=6:NA=5:NB=3:NC=0:PROC057
PROC057 ELEMENTS OF VECTOR TRANSFORMATION MATRIX, X Y Z TO x y z,
DIRECTION COSINES l m n OF LOCAL AXES x y z
x DCs,
LET N1=NB:N2=NA:PROC057B
PROC057B DIRECTION COSINES,VECTOR SUBTRACTION,
LET l=X(N1)-X(N2):m=Y(N1)-Y(N2):n=Z(N1)-Z(N2)
L= SQR(l^2+m^2+n^2)= 264.9
LET l=l/L:m=m/L:n=n/L
END057B
LET lx=l:mx=m:nx=n
z DCs,
LET N1=NC:N2=NA:PROC057B
PROC057B DIRECTION COSINES,VECTOR SUBTRACTION,
LET l=X(N1)-X(N2):m=Y(N1)-Y(N2):n=Z(N1)-Z(N2)
L= SQR(l^2+m^2+n^2)= 599.7
LET l=l/L:m=m/L:n=n/L
END057B
LET lyp=l:myp=m:nyp=n
LET lz=mx*nyp-nx*myp:mz=nx*lyp-lx*nyp:nz=lx*myp-mx*lyp
L= SQR(lz^2+mz^2+nz^2)= 0.3797
LET lz=lz/L:mz=mz/L:nz=nz/L
y DCs,
LET ly=mz*nx-nz*mx:my=nz*lx-lz*nx:ny=lz*mx-mz*lx
L= SQR(ly^2+my^2+ny^2)= 1
LET ly=ly/L:my=my/L:ny=ny/L
Invert Matrix A,
LET b11=my*nz-ny*mz:b12=-(mx*nz-nx*mz):b13=mx*ny-nx*my
LET b21=-(ly*nz-ny*lz):b22=lx*nz-nx*lz:b23=-(lx*ny-nx*ly)
LET b31=ly*mz-my*lz:b32=-(lx*mz-mx*lz):b33=lx*my-mx*ly
dA= lx*b11-ly*b12+lz*b13= -0.9862
LET a11=b11/dA:a12=b21/dA:a13=b31/dA
LET a21=b12/dA:a22=b22/dA:a23=b32/dA
LET a31=b13/dA:a32=b23/dA:a33=b33/dA
END057
LET N1=1:Nn=7:PROC057A
PROC057A COORDS TRANSFORMED FROM X Y Z TO x y z,
A1 = 1
LET VX=X(A1):VY=Y(A1):VZ=Z(A1):PROC057C
PROC057C VECTOR TRANSFORMATION, FROM V to v,
vx= VX*a11+VY*a12+VZ*a13= -648.9
vy= VX*a21+VY*a22+VZ*a23= -460.8
vz= VX*a31+VY*a32+VZ*a33= 0
END057C
LET X(A1)=vx:Y(A1)=vy:Z(A1)=vz
A1 = 2
LET VX=X(A1):VY=Y(A1):VZ=Z(A1):PROC057C
PROC057C VECTOR TRANSFORMATION, FROM V to v,
vx= VX*a11+VY*a12+VZ*a13= -629.4
vy= VX*a21+VY*a22+VZ*a23= -226.3
vz= VX*a31+VY*a32+VZ*a33= 0
END057C
LET X(A1)=vx:Y(A1)=vy:Z(A1)=vz
A1 = 3
LET VX=X(A1):VY=Y(A1):VZ=Z(A1):PROC057C
PROC057C VECTOR TRANSFORMATION, FROM V to v,
vx= VX*a11+VY*a12+VZ*a13= -584.6
vy= VX*a21+VY*a22+VZ*a23= -177.2
vz= VX*a31+VY*a32+VZ*a33= 0
END057C
LET X(A1)=vx:Y(A1)=vy:Z(A1)=vz
A1 = 4
LET VX=X(A1):VY=Y(A1):VZ=Z(A1):PROC057C
PROC057C VECTOR TRANSFORMATION, FROM V to v,
vx= VX*a11+VY*a12+VZ*a13= -355.9
vy= VX*a21+VY*a22+VZ*a23= 51.03
vz= VX*a31+VY*a32+VZ*a33= 0
END057C
LET X(A1)=vx:Y(A1)=vy:Z(A1)=vz
A1 = 5
LET VX=X(A1):VY=Y(A1):VZ=Z(A1):PROC057C
PROC057C VECTOR TRANSFORMATION, FROM V to v,
vx= VX*a11+VY*a12+VZ*a13= -290.6
vy= VX*a21+VY*a22+VZ*a23= 53.72
vz= VX*a31+VY*a32+VZ*a33= 0
END057C
LET X(A1)=vx:Y(A1)=vy:Z(A1)=vz
A1 = 6
LET VX=X(A1):VY=Y(A1):VZ=Z(A1):PROC057C
PROC057C VECTOR TRANSFORMATION, FROM V to v,
vx= VX*a11+VY*a12+VZ*a13= -21.98
vy= VX*a21+VY*a22+VZ*a23= 53.72
vz= VX*a31+VY*a32+VZ*a33= 0
END057C
LET X(A1)=vx:Y(A1)=vy:Z(A1)=vz
A1 = 7
LET VX=X(A1):VY=Y(A1):VZ=Z(A1):PROC057C
PROC057C VECTOR TRANSFORMATION, FROM V to v,
vx= VX*a11+VY*a12+VZ*a13= 117.6
vy= VX*a21+VY*a22+VZ*a23= 666.8
vz= VX*a31+VY*a32+VZ*a33= -113.6
END057C
LET X(A1)=vx:Y(A1)=vy:Z(A1)=vz
END057A
LET N1=NB:N2=NA:PROC057B
PROC057B DIRECTION COSINES,VECTOR SUBTRACTION,
LET l=X(N1)-X(N2):m=Y(N1)-Y(N2):n=Z(N1)-Z(N2)
L= SQR(l^2+m^2+n^2)= 268.6
LET l=l/L:m=m/L:n=n/L
END057B
LET VX=-2.3*9.81:VY=9.4*9.81:VZ=4*9.81:PROC057C
PROC057C VECTOR TRANSFORMATION, FROM V to v,
vx= VX*a11+VY*a12+VZ*a13= -91.28
vy= VX*a21+VY*a22+VZ*a23= 30.56
vz= VX*a31+VY*a32+VZ*a33= 39.79
END057C
LET N1=NB:N2=NC:N3=NA:La=FNl(N2,N3):Lb=FNl(N1,N3):Lc=FNl(N1,N2):PROC057D
PROC057D COSINE RULE,
ANG= DEG(ACS((La^2-Lb^2-Lc^2)/(2*Lb*Lc)))= 38.15
END057D