# How to substitute variables in interpolated function?

I'm looking for the way to substitute variables in interpolated function again to original one.

(I want to know how to get P(r, theta) from Psol(v, w).)

The original variables :

    r , theta (d<=r<=Infinity, 0<=theta<=Pi).


New variables :

    v , w (0<=v<=1, 0<=w<=1).


The relationship is

.

I now have the interpolated solution Psol(v, w). Psol(v,w) has no analytic expression, and was interpolated from numerical calculation.

The final goal is to get P(r=d), after angle-averaging the P(r,theta)

.

I want to know how to get P(r, theta) from Psol(v, w) using above variable-to-variable relationship.

-
Why not replace the $v$ and $w$ in your Psol with the expressions you have? Your question could be a bit more concrete; we don't even know what your "interpolated solution" looks like. –  Ｊ. Ｍ. Aug 8 '12 at 5:06
You can make a simple change of variable in the integral P(r) itself and have it re-written terms of v and w. –  Vitaliy Kaurov Aug 8 '12 at 5:12
@J.M. Thank you for your advice. :) –  Jaehoon Kim Aug 8 '12 at 12:01
@VitaliyKaurov, Thanks for your advice. :) –  Jaehoon Kim Aug 8 '12 at 12:02

Something like:

sol = NDSolve[{D[p[v, w], v] == D[p[v, w], w, w], p[0, w] == 0,
p[v, 0] == Sin[v], p[v, 5] == 0}, p, {v, 0, 10}, {w, 0, 5}]


Plot3D[Evaluate[p[v, w] /. %], {v, 0, 10}, {w, 0, 5}, PlotRange -> All]


pt[r_, \[Theta]_, rc_, d_, \[Gamma]_] /; d <= r := (p[v, w] /. sol ) /.
{v -> (Exp[-\[Gamma] rc/r] - Exp[-\[Gamma] rc/d])/(1 - Exp[-\[Gamma] rc/d]),
w -> \[Theta]/Pi};
Plot3D[{pt[r, \[Theta], .9, 0.3, 1], pt[r, \[Theta], .1, 0.3, 1]},
{r, 0.3, 3}, {\[Theta], 0, Pi}, PlotRange -> All]


?

-
Yes. Your code helped me. It works nice. Thank you. :) –  Jaehoon Kim Aug 8 '12 at 7:08
@JaehoonKim, my pleasure. Welcome to MathematicaSE. –  kguler Aug 8 '12 at 7:14