Hi!
Not sure if I'm doing something incredibly stupid, but...
I've got a function that generates matrices by looking up values out of
some tables. It seems to run correctly the first time, but once I've run
it, it
keeps producing the same results irrespective of what parameters I pass
it.
(%i1) load("eigen");
(%o1) /usr/share/maxima/5.9.2/share/matrix/eigen.mac
(%i2) tetmat(el_nodes, verts):= block([tetmat, tetmat_inv, coord_mat],
display(el_nodes),
coord_mat[i,j]:=verts[el_nodes[i]][j],
disfun(coord_mat),
tetmat:(addcol(columnvector([1,1,1,1]),
genmatrix(coord_mat,4,3)))
)$
(%i3) symvert:matrix( [x1, y1, z1],
[x2, y2, z2],
[x3, y3, z3],
[x4, y4, z3])$
(%i4) tetmat([1,2,3,4],symvert);el_nodes=[1,2,3,4]
(%o4) matrix( [1,x1,y1,z1],
[1,x2,y2,z2],
[1,x3,y3,z3],
[1,x4,y4,z3])
(%i5) tetmat([4,3,2,1],symvert);el_nodes=[4,3,2,1]
(%o5) matrix( [1,x1,y1,z1],
[1,x2,y2,z2],
[1,x3,y3,z3],
[1,x4,y4,z3])
As can be seen from the display(el_nodes) output, the correct values
seem
to be passed to the function, but the wrong matrix gets generated... If
I
now restart maxima, and define tetmat and symvert as before, I get:
(%i4) tetmat([4,3,2,1],symvert);el_nodes=[4,3,2,1]
(%o4) matrix( [1,x4,y4,z3],
[1,x3,y3,z3],
[1,x2,y2,z2],
[1,x1,y1,z1])
which is correct.
I'm running Maxima 5.9.2. Hints appreciated :)
Thanks
Neilen
--
you know its kind of tragic
we live in the new world
but we've lost the magic
-- Battery 9 (www.battery9.co.za)