Thanks in advance!
deff('[P]=LieProd(X,Y)','P=X*Y-Y*X');
example
X=[1,1;3,4]
Y=[5,6;7,8]
LieProd(X,Y)
Is it possible to make a new product called GP(X,Y) = A*X*B*Y*C +
D*Y*E*X*F where A, B, C, D, E, and F are all variables and not
constants, so that you can expand GP(U,GP(V,W)) or GP(GP(U,V),W)? I
need to be able to do this to test out a more Generalized Product for
matrixes, for reasons I'd prefer to discuss once I am successful with
what I am trying to do.
Hello,
You can define a new type, for example mat and overload multiplication
operator for type mat, for example :
M=mlist(['mat' 'val'],[1 2;3 4]);
N=mlist(['mat' 'val'],[5 6;7 8]);
deff('[P]=%mat_m_mat(A,B)','P=A.val*B.val-B.val*A.val')
Just type M*N and scilab will return [M,N]. Type "help overloading" to
have more informations about overloading in scilab.
Calixte
It will be better to return a mat so we should define :
deff('[P]=%mat_m_mat(A,B)','P=mlist([''mat'' ''val''],A.val*B.val-
B.val*A.val)');
Calixte
Thanks! Is there any way to include variables in the new matrix
function, so that AB = U*A*V*B*W + X*B*Y*A*Z in my new matrix function?
Hello,
Take a look to the command "global".
Calixte
Okay, because U, V, W, X, Y, and Z are supposed to be arbitrary
variables, and A and B (and C) are supposed to be the input.
For example, say I have G(A,B,C) = F(F(A,B),C) - F(A,F(B,C)) with F
(D,E) = U*D*V*E*W + X*E*Y*D*Z, and then set up an equation. My goal is
to create an equation G(A,B,C) = G(B,C,A) = G(C,A,B) = -G(C,B,A) = -G
(A,C,B) = -G(B,A,C) where A, B, and C are all matrixes.
All I need to be able to do is simplify the equation and seperate out
each permutation of A, B, and C and that can be done manually or
automatically just as long as G(A,B,C) simplifies given a function F
(D,E).
Alternative Algebra is serious business to me, as you can see.