| Author |
Comment/Response |
Adam
|
08/30/12 12:32pm
In Response To 'Re: Help with changing variables' --------- Thanks. I don't think this is quite what I want to do, which is more along the lines of this:
In[1]:= exp1[r_] := D[b[r], r] + D[n[r], r]
In[2]:= exp1[r] /. {b -> Function[r, b[1/r]], r -> 1/x}
Out[2]:= -x^2 b′[x]+n′[1/x]
Except in this case I've only done the transformation to b[r]. I'd like to be able to apply it to all functions in this expression, including n[r] and any other functions which may be there, without transforming each one individually. So I figure I should be able to do some sort of pattern-matching, but I can't figure out how to do that.
For clarification, I'm looking for the simplest way of changing variables in a differential expression or equation in Mathematica. I'd think that wouldn't be a tough thing to do. This method of replacing b -> Function[r, b[1/r]], r -> 1/x may not be that way, but it's one that I've found which works somewhat.
URL: , |
|