Message Boards Message Boards

0
|
5071 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

InverseFunction: issues with the solution of heat diffusion

Posted 10 years ago

Hi every one

I'm having some troubles with the InverseFunction operator and I don't understand where it comes from. Here's my problem:

I solved the heat equation with a cylindrical laplacien and I considered that the temperature only depends on the radius. Then, I'm looking for solutions with the form: T(r)*exp(iwt). I'm also fixing the temperature on the border: for r=rmin we got T=dT (dT is a constant equal to 1) and for r=rmax we got T=0.

Thus the heat equation becomes:

Ks = 148;
Cs = 711;
rhos = 2338;
d = N[Ks/(rhos*Cs)]; "diffusion coefficient";
rmin = 50*10^(-6);
rmax = 500*10^(-6);
dT=1;
sol = DSolve[{d T''[r] + ( d/r) T'[r] == I w T[r], T[rmin] == dT, T[rmax] == 0}, T[r], {r, rmin, rmax}];
f = 1000;
w = 2*Pi*f;
Tiso[r_] = Abs[T[r] ] /. First[sol]

So at this point I solved the heat diffusion equation for the frequency f=1000Hz and the modul of the solution is the function Tiso. Then I'd like to inverse Tiso in order to get the radius for an isotherm. I plotted Tiso, so I know the values are between 0 and 1 for r between rmin and rmax:

Plot[Tiso[r], {r, rmin, rmax}]

For exemple, let's say I want to tknow the value of the radius where Tiso = 0.5

So I need to inverse Tiso So I wrote:

InverseFunction[Tiso][0.5]

But I can't get the numerical value, even when I write:

 N[InverseFunction[Tiso][0.5]]

At first I thought I had issues because my solution is a combinaison of different Bessel Function. Yet, I tried to invert a Bessel function and I had no problem to get the numerical value:

z =. ..;
g[z_] = BesselJ[0, z]
inve = InverseFunction[g]
inve[0.5]

Does anyone has an idea of how I can return the numerical value of my InverseFunction[Tiso][0.5] ?

Cheers, Olivier

2 Replies

Thanks for the trick :)

The function you've provided doesn't seem to be injective. That presents a problem since InverseFunction might choose either of the branchs that invert the function.

InverseFunction is kinda a strange function. You can think of it as a wrapper for Solve and NSolve. where InverseFunction[f][a] is:

Solve[f[x] == a, x]

So your problem is equivalent to:

NSolve[(Abs[T[r]] /. First[sol]) == 1/2, r]

NSolve finds this a bit too hard to handle. FindRoot is a bit better at handling this:

FindRoot[(Abs[T[r]] /. First[sol]) == 1/2, {r, 0.0003}]
{r -> 0.000111705}

A rough definition of the inverse function could be:

myInverse[a_?NumericQ] := 
 r /. FindRoot[Abs[(Abs[T[r]] /. First[sol])] == a, {r, 0.0003}]
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract