Ondřej Čertík
unread,Aug 22, 2014, 7:38:36 PM8/22/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Hi,
We have the following problem: given a (complicated) expression "e",
and a set of known expressions s1, s2, s3, ..., we would like to
rewrite "e", so that it can be written in terms of any subset of s1,
s2, s3, ..... Some examples:
e = x^2+2*x*y+z^2
s1 = x+y
then we would like to get e == s1^2. Or:
e = a*x+a*y
s1 = x+y
then e == a*s1.
Actually, what we really need is given an integral, like this (much
more complicated in practice):
e = c*Integral(x**2, (x, a, b))
s1 = Integral(y**2, (y, a, b))
then it would give me e==c*s1. Notice the different dummy variable.
Here is another example, it would be able to recognize variable
substitutions:
e = c*Integral(x**2, (x, a, b))
s1 = Integral(sin(y)**2, (y, asin(a), asin(b)))
# I hope I substituted correctly
The goal is to have a large database of known expressions s1, s2, s3,
... s10000, and then if given a new expression, SymPy would be able to
figure out a way to write it in terms of them (I understand that it
might not always succeed).
This came up when discussing a particular application with Wang-Kong,
a colleague of mine at LANL. It would be used in condensed matter
physics, regarding conductivity calculations, that it would be nice to
write expressions for new materials ("e") in terms of known ones ("s1,
s2, ...").
Ondrej