I wrote this up today. In physics.mechanics we often have to sub symbols 
for values (or a smaller subset of symbols, i.e. the "operating point"). 
For the huge expressions generated, `subs` is extremely slow. Also, it subs 
inside derivatives, which is not ideal (we are currently using a hacky 
work-around). It also seems to be overkill for what's needed. More details 
are in the docstring of the attached gist. 

https://gist.github.com/jcrist/8ce1a79dfe0b42723550

I'd like some serious code design review of this. Is what I'm doing (direct 
naive replacement) bad? Is there a better way, that doesn't sacrifice 
speed? Note that for expressions of this size, xreplace, replace, and subs 
all perform equally poorly.


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/ff02f642-7c4d-4f69-8379-101292019807%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to