GENTRAN.LOG 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. MATRIX M(3,3)$
  3. M(1,1) := 18*COS(Q3)*COS(Q2)*M30*P**2 - 9*SIN(Q3)**2*P**2*M30
  4. - SIN(Q3)**2*J30Y + SIN(Q3)**2*J30Z + P**2*M10
  5. + 18*P**2*M30 + J10Y + J30Y;
  6. 2 2 2
  7. m(1,1) := 18*cos(q2)*cos(q3)*m30*p - sin(q3) *j30y + sin(q3) *j30z
  8. 2 2 2 2
  9. - 9*sin(q3) *m30*p + j10y + j30y + m10*p + 18*m30*p
  10. M(2,1) :=
  11. M(1,2) := 9*COS(Q3)*COS(Q2)*M30*P**2 - SIN(Q3)**2*J30Y +
  12. SIN(Q3)**2*J30Z - 9*SIN(Q3)**2*M30*P**2 + J30Y +
  13. 9*M30*P**2;
  14. 2 2 2
  15. m(2,1) := m(1,2) := 9*cos(q2)*cos(q3)*m30*p - sin(q3) *j30y + sin(q3) *j30z
  16. 2 2 2
  17. - 9*sin(q3) *m30*p + j30y + 9*m30*p
  18. M(3,1) :=
  19. M(1,3) := -9*SIN(Q3)*SIN(Q2)*M30*P**2;
  20. 2
  21. m(3,1) := m(1,3) := - 9*sin(q2)*sin(q3)*m30*p
  22. M(2,2) := -SIN(Q3)**2*J30Y + SIN(Q3)**2*J30Z - 9*SIN(Q3)**2
  23. *M30*P**2 + J30Y + 9*M30*P**2;
  24. 2 2 2 2 2
  25. m(2,2) := - sin(q3) *j30y + sin(q3) *j30z - 9*sin(q3) *m30*p + j30y + 9*m30*p
  26. M(3,2) :=
  27. M(2,3) := 0;
  28. m(3,2) := m(2,3) := 0
  29. M(3,3) := 9*M30*P**2 + J30X;
  30. 2
  31. m(3,3) := j30x + 9*m30*p
  32. GENTRANLANG!* := 'FORTRAN$
  33. FORTLINELEN!* := 72$
  34. GENTRAN LITERAL "C", CR!*,
  35. "C", TAB!*, "*** COMPUTE VALUES FOR MATRIX M ***", CR!*,
  36. "C", CR!*$
  37. c
  38. c *** compute values for matrix m ***
  39. c
  40. FOR j:=1:3 DO
  41. FOR k:=j:3 DO
  42. GENTRAN M(j,k) ::=: M(j,k)$
  43. m(1,1)=18.0*cos(real(q2))*cos(real(q3))*m30*p**2-(sin(real(q3))**2
  44. . *j30y)+sin(real(q3))**2*j30z-(9.0*sin(real(q3))**2*m30*p**2)+j10y
  45. . +j30y+m10*p**2+18.0*m30*p**2
  46. m(1,2)=9.0*cos(real(q2))*cos(real(q3))*m30*p**2-(sin(real(q3))**2*
  47. . j30y)+sin(real(q3))**2*j30z-(9.0*sin(real(q3))**2*m30*p**2)+j30y+
  48. . 9.0*m30*p**2
  49. m(1,3)=-(9.0*sin(real(q2))*sin(real(q3))*m30*p**2)
  50. m(2,2)=-(sin(real(q3))**2*j30y)+sin(real(q3))**2*j30z-(9.0*sin(
  51. . real(q3))**2*m30*p**2)+j30y+9.0*m30*p**2
  52. m(2,3)=0.0e+000
  53. m(3,3)=j30x+9.0*m30*p**2
  54. GENTRAN LITERAL "C", CR!*,
  55. "C", TAB!*, "*** COMPUTE VALUES FOR INVERSE MATRIX ***",
  56. CR!*,
  57. "C", CR!*$
  58. c
  59. c *** compute values for inverse matrix ***
  60. c
  61. SHARE var$
  62. FOR j:=1:3 DO
  63. FOR k:=j:3 DO
  64. IF M(j,k) NEQ 0 THEN
  65. <<
  66. var := TEMPVAR NIL;
  67. MARKVAR var;
  68. M(j,k) := var;
  69. M(k,j) := var;
  70. GENTRAN
  71. EVAL(var) := M(EVAL(j),EVAL(k))
  72. >>$
  73. t0=m(1,1)
  74. t1=m(1,2)
  75. t2=m(1,3)
  76. t3=m(2,2)
  77. t4=m(3,3)
  78. COMMENT -- Contents of Matrix M: --$
  79. M := M;
  80. [t0 t1 t2]
  81. [ ]
  82. m := [t1 t3 0 ]
  83. [ ]
  84. [t2 0 t4]
  85. MATRIX MXINV(3,3)$
  86. MXINV := M**(-1)$
  87. FOR j:=1:3 DO
  88. FOR k:=j:3 DO
  89. GENTRAN MXINV(j,k) ::=: MXINV(j,k)$
  90. mxinv(1,1)=(t3*t4)/(t0*t3*t4-(t1**2*t4)-(t2**2*t3))
  91. mxinv(1,2)=-(t1*t4)/(t0*t3*t4-(t1**2*t4)-(t2**2*t3))
  92. mxinv(1,3)=-(t2*t3)/(t0*t3*t4-(t1**2*t4)-(t2**2*t3))
  93. mxinv(2,2)=(t0*t4-t2**2)/(t0*t3*t4-(t1**2*t4)-(t2**2*t3))
  94. mxinv(2,3)=(t1*t2)/(t0*t3*t4-(t1**2*t4)-(t2**2*t3))
  95. mxinv(3,3)=(t0*t3-t1**2)/(t0*t3*t4-(t1**2*t4)-(t2**2*t3))
  96. GENTRAN
  97. for j:=1:3 do
  98. for k:=j+1:3 do
  99. <<
  100. m(k,j) := m(j,k);
  101. mxinv(k,j) := mxinv(j,k)
  102. >>$
  103. do 25001 j=1,3
  104. do 25002 k=j+1,3
  105. m(k,j)=m(j,k)
  106. mxinv(k,j)=mxinv(j,k)
  107. 25002 continue
  108. 25001 continue
  109. END$
  110. (TIME: gentran 190 200)