Most of the time I am dealing with PDEs and as such think it would be
cool if sympy can do the right thing when pprinting an expression
involving partial derivatives. Currently it's my understanding that
only the 'd' gets rendered rather than \partial.  So my question is
whether sympy can be educated to  make the right choice?  As an
example, here is a simple example of what I get with the current
convention:

from sympy import *
from sympy import Symbol

t,x,y,z,v = symbols('txyzv')

phi = Function("rphi")

advectionEQ = phi(t,x,y,z).diff(t) + v * phi(t,x,y,z).diff(x)

pprint(advectionEQ) with the result:


    d                            d
v⋅──(φ(t, x, y, z)) + ──(φ(t, x, y, z))
    dx                           dt

As a probably too primitive suggestion, how about having the pprint
look at the number of independent variables in the above expression
and if the count is greater than 1 use \partial in place of 'd' ?

Or have the pprint do its usual thing except at the end of its work
the resulting expression is parsed for d and turned into \partial?

Another thing that  is sort of not beautiful in the above output is
that the d/dx term is always first even though the object advectionEQ
has the d/dt in the first term in the expression.  How can I get the
desired order in the output of the pprinted expression?

Thanks for suggestions/corrections.

Comer

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to