For comparison with other CAS choose from: Axiom Derive Maple Mathematica Reduce
gentranout ("gentst_mac.f");
gentst_mac.fm : matrix( [ 18*COS(Q3)*COS(Q2)*M30*P
^
2 - 9*SIN(Q3)^
2*P^
2*M30
- SIN(Q3)^
2*J30Y + SIN(Q3)^
2*J30Z + P^
2*M10 + 18*P^
2*M30
+ J10Y + J30Y,
9*COS(Q3)*COS(Q2)*M30*P^
2 - SIN(Q3)^
2*J30Y + SIN(Q3)^
2*J30Z
- 9*SIN(Q3)^
2*M30*P^
2 + J30Y + 9*M30*P^
2,
-9*SIN(Q3)*SIN(Q2)*M30*P^
2 ],
[ 9*COS(Q3)*COS(Q2)*M30*P^
2 - SIN(Q3)^
2*J30Y + SIN(Q3)^
2*J30Z
- 9*SIN(Q3)^
2*M30*P^
2 + J30Y + 9*M30*P^
2,
-SIN(Q3)^
2*J30Y + SIN(Q3)^
2*J30Z - 9*SIN(Q3)^
2*M30*P^
2 + J30Y
+ 9*M30*P^
2,
0 ],
[ -9*SIN(Q3)*SIN(Q2)*M30*P^
2,
0,
9*M30*P^
2 + J30X ] );
2 2 2 2 matrix([- 9 m30 p sin (q3) + j30z sin (q3) - j30y sin (q3) 2 2 2 + 18 m30 p cos(q2) cos(q3) + 18 m30 p + m10 p + j30y + j10y, 2 2 2 2 2 - 9 m30 p sin (q3) + j30z sin (q3) - j30y sin (q3) + 9 m30 p cos(q2) cos(q3) 2 2 + 9 m30 p + j30y, - 9 m30 p sin(q2) sin(q3)], 2 2 2 2 2 [- 9 m30 p sin (q3) + j30z sin (q3) - j30y sin (q3) + 9 m30 p cos(q2) cos(q3) 2 2 2 2 2 + 9 m30 p + j30y, - 9 m30 p sin (q3) + j30z sin (q3) - j30y sin (q3) 2 2 2 + 9 m30 p + j30y, 0], [- 9 m30 p sin(q2) sin(q3), 0, 9 m30 p + j30x])
mm : copymatrix(m)$
gentran( literal( "C", cr, "C -- Calculate Matrix Values --", cr, "C", cr ) );gentst_mac.ffor i:1 thru 3 do for j:i thru 3 do gentran( m[eval(i),eval(j)] : eval(m[i,j]) )$ gentran( literal( "C", cr, "C -- Assign Non-Zero Matrix Values to Temporary ", "Variables --", cr, "C", cr ) );
gentst_mac.ffor i:1 thru 3 do for j:i thru 3 do if m[i,j]#0 then ( var : tempvar(false), markvar(var), m[i,j] : var, m[j,i] : var, gentran( eval(var) : m[eval(i),eval(j)] ) )$
[ t0 t1 t2 ] [ ] [ t1 t3 0 ] [ ] [ t2 0 t4 ]minv : m
^
^
(-1)$
gentran( literal( "C", cr,
"C -- Calculate Inverse Matrix Values --", cr,
"C", cr ) );
gentst_mac.ffor i:1 thru 3 do for j:i thru 3 do gentran( minv[eval(i),eval(j)] : eval(minv[i,j]) )$ gentran( literal( "C", cr, "C -- Copy Entries Across Main Diagonals --", cr, "C", cr ), for i:1 thru 3 do for j:i+1 thru 3 do ( m[j,i] : m[i,j], minv[j,i] : minv[i,j] ) );
gentst_mac.fgentranshut ("gentst_mac.f");
true