I am trying to exploit maxima to check some algebric calculations of mine;
replacement of factors with others is something i am not able to get:
Here is an example, in which chi*om12 should be changed into omega12, when
the expressions are elements of a matrix, as in the batch file here enclosed.
You can see that replacemnt in gradFF matrix elements has not had effect,
i.e.:
(C49) gradFF[1,1];
(D49) 2 v (t3 v + t2 v + j2 v - chi om12 t1)
+ 4 v (t3 v - t1 v - J1 v + chi om23 t2)
+ 2 v (t2 v - t1 v - (j2 + J1) v + chi om13 t3)
By the way, gradFF is a vector, but it seemed that using a second (fixed)
index to print out its elements gave no trouble, rather it allowed to hide
the square brackets on the borders.
I have checked that replacement can be performed in simpler expressions,
so it is possible that my troubles are due to the way my matrix has been
built up.
thank you for your help
Paolo Pumlia
---- maxima batch file ----------------
/* test 1 - paolo pumilia, 30 jun 2001 */
n : 14;
array(x,n);
x[1] : j1;
x[2] : j2;
x[3] : t1;
x[4] : t2;
x[5] : t3;
x[6] : w1;
x[7] : w2;
x[8] : w3;
x[9] : R1;
x[10] : R2;
x[11] : R3;
x[12] : P1;
x[13] : P2;
x[14] : P3;
omega12 : chi*(r1 - r2);
omega13 : chi*(r1 - r3);
omega23 : chi*(r2 - r3);
F[1] : 2*v*w1 + 4*v*w2 + 2*v*w3;
F[2] : -4*v*w1 - 2*v*w2 + 2*v*w3;
F[3] : omega12*w1 + v*w3 + v*w2;
F[4] : -omega23*w2 - v*w3 + v*w1;
F[5] : -omega13*w3 - v*w1 - v*w2;
F[6] : -omega12*t1 + v*t3 + v*j2 + v*t2;
F[7] : omega23*t2 + v*t3 - v*j1 - v*t1;
F[8] : omega13*t3 - v*t1 + v*t2 - v*(j1 + j2);
F[9] : p1/M;
F[10] : p2/M;
F[11] : p3/M;
F[12] : -M*omega^2*r1 - chi*(c + j1/2 + j2)/3 - gamma*p1;
F[13] : -M*omega^2*r2 - chi*(c + j1/2 - j2/2)/3 - gamma*p2;
F[14] : -M*omega^2*r3 - chi*(c - j1 - j2/2)/3 - gamma*p3;
FF : matrix(listarray(F));
Ft : transpose(FF);
for i:1 thru n step 1 do (
for ii:1 thru n step 1 do (
y[i,ii] : diff(F[i],x[ii])
)
);
gradF : genmatrix(y,n,n);
gradFF : gradF . Ft ;
for i : 1 thru n step 1 do setelmx(subst(om12,r1 - r2,gradFF[i,1]),i,1,gradFF)$
for i : 1 thru n step 1 do setelmx(subst(-om12,r2 - r1,gradFF[i,1]),i,1,gradFF)$
for i : 1 thru n step 1 do setelmx(subst(om23,r2 - r3,gradFF[i,1]),i,1,gradFF)$
for i : 1 thru n step 1 do setelmx(subst(-om23,r3 - r2,gradFF[i,1]),i,1,gradFF)$
for i : 1 thru n step 1 do setelmx(subst(om13,r1 - r3,gradFF[i,1]),i,1,gradFF)$
for i : 1 thru n step 1 do setelmx(subst(-om13,r3 - r1,gradFF[i,1]),i,1,gradFF)$
for i : 1 thru n step 1 do setelmx(subst(omega12,chi*om12,gradFF[i,1]),i,1,gradFF)$
for i : 1 thru n step 1 do setelmx(subst(omega23,chi*om23,gradFF[i,1]),i,1,gradFF)$
for i : 1 thru n step 1 do setelmx(subst(omega13,chi*om13,gradFF[i,1]),i,1,gradFF)$
----
-----------------------------------------------------
Salve, il messaggio che hai ricevuto
è stato inviato per mezzo del sistema
di web mail interfree. Se anche tu vuoi
una casella di posta free visita il
sito http://club.interfree.it
Ti aspettiamo!
-----------------------------------------------------