gentran.rlg 3.8 KB

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