# solving a diffusion pde

• Jun 25th 2008, 05:48 AM
jescavez
solving a diffusion pde
Hallo everyone

Please may I ask for some tips to help me solving this question.

I have this equation:

$\frac{\partial^2t}{\partial{x^2}}+\frac{\partial^2 t}{\partial{y^2}}=-2$

this equation needs to be solved using the conditions where $t(x,y)=0$ with diffusion between circles $x^2+y^2=1$ and $x^2+y^2=e^2$

we assume we can solve with form $t(x,y)=f(z)$ with $z=x^2+y^2$

how can first equation with conditions now be written as:
$
z\frac{d^2{f}}{d{z^2}}+\frac{df}{dz}=-0.5,$
$\left\{\begin{array}{cc}f(1)=0,\\f(e^2)=0, \end{array}\right.$

if someone can please give me tip with how i work out $\frac{df}{dz}$ (because i am confuse thinking what this means) maybe I can give question a go!

Thank you
• Jun 25th 2008, 06:31 AM
flyingsquirrel
Hi jescavez
Quote:

Originally Posted by jescavez
I have this equation:

$\frac{\partial^2t}{\partial{x^2}}+\frac{\partial^2 t}{\partial{y^2}}=-2$

this equation needs to be solved using the conditions where $t(x,y)=0$ with diffusion between circles $x^2+y^2=1$ and $x^2+y^2=e^2$

we assume we can solve with form $t(x,y)=f(z)$ with $z=x^2+y^2$

how can first equation with conditions now be written as:
$
z\frac{d^2{f}}{d{z^2}}+\frac{df}{dz}=-0.5,$
$\left\{\begin{array}{cc}f(1)=0,\\f(e^2)=0, \end{array}\right.$

if someone can please give me tip with how i work out $\frac{df}{dz}$ (because i am confuse thinking what this means) maybe I can give question a go!

We have the equation $\frac{\partial^2t}{\partial{x^2}}+\frac{\partial^2 t}{\partial{y^2}}=-2$ and we want to replace $x$ and $y$ by $z=x^2+y^2$ so we need to compute $\frac{\partial^2t}{\partial{y^2}}=\frac{\partial^2 f}{\partial{y^2}}$ and $\frac{\partial^2t}{\partial{x^2}}=\frac{\partial^2 f}{\partial{x^2}}$ in terms of $f''(z)$ and $f'(z)$. Let's start with $\frac{\partial t(x,y)}{\partial x}=\frac{\partial f(z)}{\partial x}$ :

The chain rule states that $\big( v\circ u\big) ' = u'\cdot v'\circ u$ hence $\frac{\partial f(z)}{\partial x}=\frac{\partial z}{\partial x}\cdot f'(z)=2x f'(z)$

Let's differentiate $f$ a second time with respect to $x$ :

\begin{aligned}
\frac{\partial ^2 f(z)}{\partial x^2}&=\frac{\partial }{\partial x}\Big[2x f'(z)\Big]\\
&=2f'(z)+2x\frac{\partial f'(z)}{\partial x}
\end{aligned}

Now what is $\frac{\partial f'(z)}{\partial x}$ ? Again, let's use the chain rule :

$\frac{\partial f'(z)}{\partial x}=\frac{\partial z}{\partial x}\cdot f''(z)=2xf''(z)$

hence $\frac{\partial ^2 f(z)}{\partial x^2}=2f'(z)+4x^2f''(z)$

Following this idea you can compute $\frac{\partial ^2 t}{\partial y^2}= \frac{\partial ^2 f}{\partial y^2}$. Substituting $\frac{\partial ^2 t}{\partial y^2}$ and $\frac{\partial ^2 t}{\partial y^2}$ by their expressions in terms of $f''(z)$ and $f'(z)$ in the differential equation will give you the equation $zf''(z)+f'(z)=-1/2$ you're looking for.

Hope it helps !
• Jun 25th 2008, 09:03 AM
jescavez
Thank you flying squirrel that was a great explanation I have it now.

May I to clarify one other point? It is very relate to this, I have equation:

$t(x,y)=\frac{1}{2}(1-(x^2+y^2))+\frac{1}{4}(e^2-1)log(x^2+y^2)$

I see that $(1-(x^2+y^2))=0$ and $(e^2-1)=0$ and $log(x^2+y^2)=2$ and I think it is trying to say $t(x,y)=0$ but I don't understand why the $\frac{1}{2}$ and $\frac{1}{4}$ are need or must to be there as I think they are multiplying by 0 anyway?

Thank you and sorry for extra question!
• Jun 25th 2008, 09:41 AM
flyingsquirrel
Quote:

Originally Posted by jescavez
May I to clarify one other point? It is very relate to this, I have equation:

$t(x,y)=\frac{1}{2}(1-(x^2+y^2))+\frac{1}{4}(e^2-1)log(x^2+y^2)$

I see that $(1-(x^2+y^2))=0$ and $(e^2-1)=0$ and $log(x^2+y^2)=2$ and I think it is trying to say $t(x,y)=0$ but I don't understand why the $\frac{1}{2}$ and $\frac{1}{4}$ are need or must to be there as I think they are multiplying by 0 anyway?

I'm not sure to understand what you mean : if one replaces $\frac{1}{2}$ by say $42$, the new function is not a solution of our problem anymore :

We know that the solutions of $zf''(z)+f'(z)=-\frac{1}{2}$ are $A\ln z-\frac{1}{2}z+B$. The two constants $A$ and $B$ are obtained with the two following conditions

$
\begin{cases}
f(1)=0\\
f(e^2)=0
\end{cases}
\implies\begin{cases}
1\ln 1-\frac{1}{2}\cdot 1+B=0\\
A\ln e^2-\frac{1}{2}e^2+B=0
\end{cases}
\implies
\begin{cases}
B=\displaystyle\frac{1}{2}\\
A=\displaystyle\frac{1-e^2}{4{\color{red}\ln e}}
\end{cases}$

Changing the value of $A$ or the value $B$ makes at least one of the these conditions become false : the function with the new value of $A$ or $B$ can't be a solution of this problem.

EDIT : If $e=\exp 1$ don't take into account what I wrote in red.
• Jun 25th 2008, 10:32 AM
jescavez
Ah, ok I did not realise the solution would take this form. please could you explain me where $
A\ln z-\frac{1}{2}z+B
$
come from?
Thank you.
• Jun 25th 2008, 11:47 AM
flyingsquirrel
Quote:

Originally Posted by jescavez
Ah, ok I did not realise the solution would take this form. please could you explain me where $
A\ln z-\frac{1}{2}z+B
$
come from?

I thought you'd solved it. :D

Let $y=f'(z)$.

The differential equation $zf''(z)+f'(z)=-\frac{1}{2}$ can be written $zy'+y=-\frac{1}{2} \implies y'=-\frac{1}{z}\left(y+\frac{1}{2}\right) \Longleftrightarrow \left( y+\frac{1}{2}\right)'=-\frac{1}{z}\left( y+\frac{1}{2}\right)$

This is a first-order ODE which solutions are $y+\frac{1}{2}=\exp\left(\int -\frac{\mathrm{d}u}{u}\right)=\exp\left(-\ln z + C \right)=\frac{A}{z}$. Thus $f'(z)=\frac{A}{z}-\frac{1}{2}$ which gives us $f(z)=A\ln z-\frac{1}{2}z+B$ when integrated.
• Jun 25th 2008, 01:11 PM
jescavez
Thanks flying squirrel. What is that technique called?

a couple of Qs. why in:

$
zy'+y=-\frac{1}{2} \implies y'=-\frac{1}{z}\left(y+\frac{1}{2}\right) \Longleftrightarrow \left( y+\frac{1}{2}\right)'=-\frac{1}{z}\left( y+\frac{1}{2}\right)
$

does the implied bit work?
and I'm not quite sure how you get to:

$
y+\frac{1}{2}=\exp\left(\int -\frac{\mathrm{d}u}{u}\right)
$

(And last question, hopefully, sorry!)For this bit:

$
\begin{cases}
f(1)=0\\
f(e^2)=0
\end{cases}
\implies\begin{cases}
1\ln 1-\frac{1}{2}\cdot 1+B=0\\
A\ln e^2-\frac{1}{2}e^2+B=0
\end{cases}
\implies
\begin{cases}
B=\displaystyle\frac{1}{2}\\
A=\displaystyle\frac{e^2-1}{4{\color{red}\ln e}}
\end{cases}
$

we are adding the solutions right to get to final equation? then what happens to the $-\frac{1}{2}e^2+B$ part of $f(e^2)$? we do not seem to use it?

Thank you again.
• Jun 26th 2008, 12:29 AM
flyingsquirrel
Quote:

Originally Posted by jescavez
What is that technique called?

I don't think it has a name. :D

Quote:

why in:

$
zy'+y=-\frac{1}{2} \implies y'=-\frac{1}{z}\left(y+\frac{1}{2}\right) \Longleftrightarrow \left( y+\frac{1}{2}\right)'=-\frac{1}{z}\left( y+\frac{1}{2}\right)
$

does the implied bit work?
I don't understand what you mean :(

Quote:

and I'm not quite sure how you get to:

$
y+\frac{1}{2}=\exp\left(\int -\frac{\mathrm{d}u}{u}\right)
$

Quote:

(And last question, hopefully, sorry!)
There is no need to apologize each time you ask a question. :)
Quote:

For this bit:

$
\begin{cases}
f(1)=0\\
f(e^2)=0
\end{cases}
\implies\begin{cases}
1\ln 1-\frac{1}{2}\cdot 1+B=0\\
A\ln e^2-\frac{1}{2}e^2+B=0
\end{cases}
\implies
\begin{cases}
B=\displaystyle\frac{1}{2}\\
A=\displaystyle\frac{e^2-1}{4{\color{red}\ln e}}
\end{cases}
$

we are adding the solutions right to get to final equation? then what happens to the $-\frac{1}{2}e^2+B$ part of $f(e^2)$? we do not seem to use it?
We do use this term :


\begin{aligned}
A\ln e^2-\frac{1}{2}e^2+B=0
&\implies A\ln e^2-\frac{1}{2}e^2+\frac{1}{2}=0\\
&\implies 2A\ln e = \frac{e^2-1}{2}\\
&\implies A=\frac{e^2-1}{4\ln e}\\
\end{aligned}

If you want to do this by subtracting one equation to the other :


\begin{aligned}
\begin{cases}
1\ln 1-\frac{1}{2}\cdot 1+B=0 & (1)\\
A\ln e^2-\frac{1}{2}e^2+B=0 &(2)
\end{cases} &\implies (2)-(1) : A\ln e^2-\frac{1}{2}e^2+\frac{1}{2}=0\\
&\implies A=\frac{\frac{1}{2}e^2-\frac{1}{2}}{2\ln e}\\
&\implies A=\frac{e^2-1}{4\ln e}
\end{aligned}
• Jun 26th 2008, 11:10 AM
jescavez
Quote:

Originally Posted by flyingsquirrel

I don't understand what you mean :(

I mean the $y'$ going to $y' + \frac{1}{2}$ without anything else changing. I don't understand why that is ok to do (I see that once differentiated the 1/2 goes but I would have thought you can say same about any constant...)

Thank you
• Jun 26th 2008, 11:57 AM
flyingsquirrel
Quote:

Originally Posted by jescavez
I mean the $y'$ going to $y' + \frac{1}{2}$ without anything else changing. I don't understand why that is ok to do (I see that once differentiated the 1/2 goes but I would have thought you can say same about any constant...)

Yes, it would also have been right with any other constant. Choosing $\frac{1}{2}$ allows one to write the differential equation $\left(y+\frac{1}{2}\right)'=-\frac{1}{z}\left(y+\frac{1}{2}\right)$ as $Y'=-\frac{Y}{z}$ with $Y=y+\frac{1}{2}$. I found this interesting since the equation in terms of $Y$ is a little bit easier to solve than $zy'+y=-\frac{1}{2}$ : with the notations used in the link given in my previous post, for the equation $Y'=-\frac{Y}{z}$ we have $q(z)=0$ hence $Y$ is simply $\frac{C}{u(z)}$ whereas for the equation $zy'+y=-\frac{1}{2}$ we have $q(z)=-\frac{1}{2z}$ so one has to compute $y=-\frac{\int \frac{1}{2z} u(z)\,\mathrm{d}z+C'}{u(z)}$ ...