I have this partial differential equation
http://en.wikipedia.org/wiki/Burgers%27_equation
To which I want to substitute an ansatz that depends just on one variable: 
f(xi), where xi is a function of the two independent variables x and t.
After the substitution, I would like to isolate the derivative d(f)/d(xi).

I tried writing a script to do it, but I can't refer to the relevant 
derivative.
Attached herein is the script. Here's the output I get:

(-nu*xi**3*Subs(Derivative(f(_xi_1), _xi_1), (_xi_1,), (xi,))/2 - 
nu*xi**2*Subs(Derivative(f(_xi_1), _xi_1, _xi_1), (_xi_1,), (xi,)) + 
2*nu*xi*Subs(Derivative(f(_xi_1), _xi_1), (_xi_1,), (xi,)) - 2*nu*f(xi) + 
xi*f(xi)*Subs(Derivative(f(_xi_1), _xi_1), (_xi_1,), (xi,)) - 
f(xi)**2)/(xi**3*(nu*t)**(3/2))
[]
None

Any help will be welcome. 

- Almog

-- 
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.
def burgers(f,x,t, nu):

    import sympy

    return sympy.diff(f,t)+f*sympy.diff(f,x)-nu*sympy.diff(f,x,2)

def main():

    import sympy

    x, t, nu, xi = sympy.var('x, t, nu, xi')
    f = sympy.Function('f')

    temp = burgers(f(x/sympy.sqrt(nu*t))/x,x,t,nu)
    temp = temp.subs(x,xi*sympy.sqrt(nu*t))
    temp = sympy.simplify(temp)

    print temp
    
    print sympy.solve(temp,sympy.diff(f(xi),xi))

    wc = sympy.Wild('wc')
    print temp.match(sympy.diff(f(wc),wc))

if __name__ == '__main__':

    main()

Reply via email to