> It should be easy to implement such a class. I would suggest the name
> MatExponential. We already have a MatPow for the case A**b (A a matrix, b a
> scalar). I would suggest looking at MatPow and MatMul as examples. You'll
> also have to change the __rpow__ operator in MatExpr (look at the
> surrounding functions to see what to do). This should allow for the syntax
> e**A but not exp(A).
I've implemented such a class, and it seems to works. I can now manage
to compute (e**(q*A)).diff(q).
However, I still have a major problem : sympy does not manage to
simplify e**A * (e**A)**-1, though it can simplify e**q * (e**q)**-1
where A is a SymbolMatrix, and q a symbol.
See the code below. Why is that ?
from sympy import *
from sympy.matrices import *
e = Symbol('e')
q1 = Symbol('q1')
q2 = Symbol('q2')
q3 = Symbol('q3')
A = MatrixSymbol('A', 3, 3)
B = MatrixSymbol('B', 3, 3)
print (e**(q2*B)) * (e**(q2*B))**-1 # not simplified :(
print (e**(q2*q1)) * (e**(q2*q1))**-1 # simplified to 1
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.