Thanks Ondrej, Yes, "Pow" function is all right. To my problem, "pow" is converted to "Pow". However it is tentative solution and I hope "pow" should be treated formally.
czbebe On 12月8日, 午後1:49, Ondrej Certik <ond...@certik.cz> wrote: > 2009/12/7 czbebe <o...@bpe.es.osaka-u.ac.jp>: > > > > > > > Thanks Ondrej, > > >>I strongly suggest not to use this string syntax > > > I am sorry, but I want to get the derivatives of general equation > > including some functions, exp, sin/cos/tan, and pow and so on. > > It is given by a string variable. > > > import sympy > > x = sympy.symbols('x') > > f = pow(x,2) > > g = sympy.diff(f,x) > > print g > > > This gives 2*x and is correct, but f = pow(x,2) seems questionable. > > You said "no "pow" function in sympy", but g1= sympy.diff(pow(x,2),x) > > gives correct result 2*x. Why ? > > Ronan answered this above (pow is a builtin function and sympify > should be improved to use that). > > > > > Pow function is critical for me because my mathml converter gives > > pow functions even if simple x**2 is converted to pow(x,2). > > You can always substitute pow to Pow in your mathml converter and then > use sympify, that should work. Better solution is to fix sympify to > handle pow as well. > > Ondrej- 引用テキストを表示しない - > > - 引用テキストを表示 - -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.