| Author |
Comment/Response |
Adam
|
08/27/12 10:22pm
I'm trying to find a simple way in Mathematica to change variables in a differential equation or differential expression (what dchange in PDETools does in Maple). I'm starting with a particularly simple case where I have functions of a single variable r and transform to x=1/r. So let's say I have
exp1[r_] := D[b[r], r] + D[n[r], r]
then I can change variables in one of the functions by doing
exp1[r] /. {b -> Function[r, b[1/r]], r -> 1/x}
but if I try to do a pattern like
exp1[r] /. {f_ -> Function[r, f[1/r]], r -> 1/x}
so that it applies the transformation rule to both b(r) and n(r) (and any other functions I might put in) then I get some unintelligible output. How do I get this change of variables to work?
URL: , |
|