Hello everybody,
I've been using sympy to solve some homework problems that tend to be
a bit cumbersome on a calculator, and I have to say thanks alot, it's
really an awesome project. Tonight, I was working on some linear
algebra for a mechanical vibrations problem and I ran into a issue
with simplify. I have a "calculator" program I was using that looks
like this:
from sympy import *
from sympy.matrices import Matrix
Basic.set_repr_level(2)
k,m,w,f = symbols('kmwf')
A = Matrix([[2*k-m*w**2, -k],[-k,k-m*w**2]])
A = A.inv()
B = Matrix([0,f])
C = A*B
pprint C
This yields a correct answer, but it is in an unsimplified form. To
try and simplify one of the elements into something more manageable I
tried using:
pprint( simplify(c[1]))
This works and gives the simplified answer that I confirmed with
matlab, but it takes a very long time to compute. Matlab did the
simplification almost instantly while my TI-89 took about 10 seconds
and sympy took close to a minute to compute the answer. When I tried
to simplify the first element in the matrix, I killed the program
after it had run for 5 minutes and didn't give an answer.
Is this slowness just because of this specific situation, or is it in
the simplify() method itself? If it's just a problem with my usage,
some tips on how to do this more effectively would be much
appreciated. If it's a problem with simplify itself, does anybody have
an idea what might be causing it? I'd love to try and take a look at
the source code and to try and speed it up, but I'm not sure where to
start.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---