Is it enough to just use collect(evaluate=False), with the second argument
being a list of all the things that your expressions might be coefficients
of?

Aaron Meurer


On Sun, May 26, 2013 at 10:13 AM, Alan Bromborsky <[email protected]>wrote:

> I have real scalar expressions I am trying to simplify.  The examples are
> in the attached files since the latex output is much easier to understand
> than the text output.
> Consider the expressions for the divergence and curl of A.  The divergence
> is a scalar expression and the coefficient of e_{\phi} in the curl is a
> scalar expression.
> Call either expression "coef" in paraboloidal and paraboloida1.  In
> paraboloidal I applied simplify to each "coef".  In  paraboloidal1 I took
> the additional step of
> collecting the coefficients of each function (the A's) and the derivatives
> of the functions.  The question is how do I take the next step and simplify
> the coefficients of
> the A's and their derivatives.  I am looking for a general solution in the
> sense that I can always determine the A's and the derivatives from "coef"
> via -
>
> def find_functions(expr):
>     f_lst = []
>     for f in list(expr.atoms(Function)):
>         if str(f) not in GaPrinter.function_names:
>             f_lst.append(f)
>     f_lst += list(expr.atoms(Derivative))
>     return f_lst
>
> However I wish to consider "coefs" that may have a part that is not
> multiplied by a function or its derivative.
>
> Any suggestions would be welcome.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> sympy+unsubscribe@**googlegroups.com<sympy%[email protected]>
> .
> To post to this group, send email to [email protected].
> Visit this group at 
> http://groups.google.com/**group/sympy?hl=en-US<http://groups.google.com/group/sympy?hl=en-US>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to