but you are going to have to work with me here. I can see all sorts of places whre this can be "tidied-up", but since I have no idea about your "ultimate objective" I'm going t have to go through this pretty much line by line.

I am not going to get all the way to the end of your code on a "first pass" - we start with the first few lines, and (hopefully) work on from there!

Your first entry

**Stiffness:=Matrix(6,6):**

Stiffness:=Matrix(6, 6, {(1, 1) = 20.4, (1, 2) = .537, (1, 3) = 1.01, (1, 4) = 0., (1, 5) = 0., (1, 6) = -0., (2, 1) = .537, (2, 2) = 1.59, (2, 3) = .73, (2, 4) = 0., (2, 5) = 0., (2, 6) = -0., (3, 1) = 1.01, (3, 2) = .73, (3, 3) = 2.86, (3, 4) = 0., (3, 5) = 0., (3, 6) = -0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 1.5, (4, 5) = 0., (4, 6) = -0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 2., (5, 6) = -0., (6, 1) = 0., (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = .8});

You don't have to "index" each entry separately. There are many ways to shorten Maple's matrix input: all of the shorter versions require about the same amount of typing, so I am just going to show one. The above is entirely equivalent to

**Stiffness:=Matrix( 6,**

6,

[ [ 20.4, .537, 1.01, 0., 0., -0. ],

[ .537, 1.59, .73, 0., 0., -0. ],

[ 1.01, .73, 2.86, 0., 0., -0. ],

[ 0., 0., 0., 1.5, 0., -0 .],

[ 0., 0., 0., 0., 2., -0. ],

[ 0., 0., 0., 0., 0., .8 ]

]

);

You may thing that the above code contains an excessive amount of indentation/spacing/whatever, but I write stuff this way because I find it much easier to read. If you want to write the above as

**Stiffness:=Matrix( 6,6,[ [ 20.4,.537, 1.01, 0., 0., -0.],[.537, 1.59,.73, 0., 0., -0.],[1.01, .73, 2.86, 0., 0., -0.],[ 0., 0., 0., 1.5, 0., -0.],[ 0., 0., 0., 0., 2., -0.],[0., 0., 0., 0., 0., .8 ]] );**

then that is absolutely fine with me! Either of the above solutions is waaaaay shorter than typing your original.

Next point is rotation matrices: you **really, reall**y do not have to type these explicitly, because given an axis and an angle, Maple will generate them for you ( you can check out the help for these by entering ?rotationmatrix at the Maple prompt), but basically all you need to know is the rotation angle, and the axis of rotation, so consider the following examples

**with(Student[LinearAlgebra]):**

R1a:=RotationMatrix(Pi/4, <1,0,0>); # rotation Pi/4 about +ve x-axis

**R1b:=RotationMatrix(Pi/4, <-1,0,0>); # rotation Pi/4 about -ve x-axis**

**R1b:=RotationMatrix(-Pi/4, <1,0,0>); # rotation -Pi/4 about +ve x-axis**

R2:=RotationMatrix(Pi/4, <0,1,0>); # rotation Pi/4 about +ve y-axis

R3:=RotationMatrix(Pi/4, <0,0,1>); # rotation Pi/4 about +ve z-axis

So don't write ytour rotation matrices explicitly - so long as you know the angle, and the axis of rotation, then Maple will generate the matrices for you. Doesn't matter what the angel is or what the axis is, Maple will still produce the matrix, so for the following totally random angle, totally random axis, Maple will still generate the relevant matrix

**Rx:=RotationMatrix(10003.754, <23.7,-15.8,17.1>);**

Now you don't seem to want these rotation matrices - rather you want their transposes (no idea why!?), but then just "nest" the commands, in order to save typing, as in

**with(Student[LinearAlgebra]):**

T1:=Transpose(RotationMatrix(Pi/4, <1,0,0>)); # transpose of rotation Pi/4 about +ve x-axis

T2:=Transpose(RotationMatrix(Pi/4, <0,1,0>)); # transpose of rotation Pi/4 about +ve y-axis

R3:=Transpose(RotationMatrix(Pi/4, <0,0,1>)); # transpose of rotation Pi/4 about +ve z-axis

Now I'd really like to shorten up the definition of your matrix R. I'm assuming that there is some kind of function/pattern, because if I could work out the general rule for how R[i,j] depended on the entries of S5, then I could make this definition much neater. But I've stared at this at your definition for a while and I can't "see" the pattern/function - so if you want this in a "short/clever" way, you are going to hav to tell me what the "pattern/function" actually is!