Thanks, William. I'll check that out. Also, for those interested in the bug i reported, i'd like to rephrase the description of my situation, because i stated it a little confusingly above. Take two. I have a big symbolic expression E involving lots of derivatives. I want to replace the derivatives with other symbolic expressions/numbers. Naturally, i'd like to perform the substitution with a dictionary D whose keys are the derivatives and whose values are the corresponding expressions/numbers. That is, i want to build D and do E.subs(D). Unfortunately, building D fails in Sage 4.2.1 when the keys are derivatives of trivariate (and possibly n- variate with n>3) functions. (I guess Burcin is getting ready to work his Sage-fu on this symbolics bug ;-) )
One workaround, suggested by William, is to convert E to a string, build D with keys the string versions of the derivatives, perform the substitution as strings, and then convert E back to a symbolic expression. I'm trying this now ---well, not right now, because it's the weekend in New Zealand. However, if anyone out there can think of a simpler temporary workaround, please let me know. Thanks again. Alex On Nov 20, 7:17 pm, William Stein <wst...@gmail.com> wrote: > On Thu, Nov 19, 2009 at 7:45 PM, Alex Raichev <tortoise.s...@gmail.com> wrote: > > Thanks for the workaround, William. I was thinking the same thing as > > a temporary fix but am having difficulties with that approach. > > > Here's my situation. I have a big symbolic expression E involving > > lots of derivatives. I want to substitute the derivatives with other > > symbolic expressions, and the substitutions are stored in a big > > dictionary D. Presently E.subs(D) does not work in Sage. > > > I tried a keyword substitution instead, but got the error > > 'SyntaxError: keyword can't be an expression (<ipython console>, line > > 1)' > > > Another approach is to convert E and the keys of D to strings, perform > > the substitution as strings, and then convert E back to a symbolic > > expression. I'm trying this now but am getting stuck with the string > > substitution step... > > > If anyone out there can think of a simpler temporary workaround, > > please let me know. > > If you're using strings, you might find this useful: > > sage: sage.misc.multireplace.multiple_replace? > > William -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org