# Similarity Solutions Example

An example shows the PDE

$$\dfrac{\partial{T}}{\partial{t}} = \alpha \dfrac{\partial^2{T}}{\partial{y^2}}$$

It says we can non-dimensionalize the system with the transformations

$$u = \dfrac{T - T_w}{T_i - T_w}, y^* = \dfrac{y}{\sqrt{\alpha t_0}}, t^* = \dfrac{t}{t_0}$$

The PDE becomes

$$\dfrac{\partial{u}}{\partial{t}^*} = \dfrac{\partial^2{u}}{\partial{y}^{*^2}}$$

Suppose we have solved for $u$. We can obtain $T$ from

$$T(y, t) = (T_i - T_w)u\left( \dfrac{y}{\sqrt{\alpha t_0}}, \dfrac{t}{t_0} \right) + T_w$$

Since $t_0$ is arbitrary, we can choose $t_0 = t$.

With $t_0 = t$, we see that $u$ is really only a function of a single variable:

$$u \left( \dfrac{y}{\sqrt{\alpha t}}, 1 \right) = f \left( \dfrac{y}{\sqrt{\alpha t}} \right)$$

Substitute this into the PDE to get an ODE:

$$\dfrac{-1}{2} \dfrac{y}{\sqrt{\alpha t}} f'\left( \dfrac{y}{\sqrt{\alpha t}} \right) = f''\left( \dfrac{y}{\sqrt{\alpha t}} \right)$$

Let $\eta = \dfrac{y}{\sqrt{\alpha t}}$. Then we have

$$-\dfrac{1}{2} \eta f'(\eta) = f''(\eta)$$

With boundary conditions

$u = 0$, $y^* = 0$, $f(0) = 0$, $u = 1$ as $y^* \to \infty$, $f \to 1$ as $\eta \to \infty$

Solving the ODE, we get

$$f(\eta) = \dfrac{1}{C} \int^\eta_0 e^{-\lambda^2 / 4} \ d \lambda, C = \int^\infty_0 e^{-\lambda^2 / 4} \ d \lambda = \sqrt{\pi}$$

There are two things I don't understand:

1. What calculations allow us to get $\dfrac{-1}{2} \dfrac{y}{\sqrt{\alpha t}} f'\left( \dfrac{y}{\sqrt{\alpha t}} \right) = f''\left( \dfrac{y}{\sqrt{\alpha t}} \right)$? Please demonstrate the calculations for this substitution.
2. How do we solve the ODE $-\dfrac{1}{2} \eta f'(\eta) = f''(\eta)$? It can be rewritten as $2f''(\eta) + \eta f'(\eta) = 0$, but I don't think there is a general solution strategy for this type of DE?

I would greatly appreciate it if people could please take the time to help me understand this.

• I added to my writings on problem 2 in your question. I believe you may have written the incorrect boundary conditions. I don't get a meaningful constant when applying the BCs to my solution, and furthermore I don't think the boundaries make physical sense. See my answer for more details. – WilliamMorris Jul 25 '18 at 8:11

For your question 1, I prefer to use the substitution $\eta=\frac{y}{\sqrt{\alpha t}}$ first, then substitute $f$ into the PDE.

$$u\Big(\frac{y}{\sqrt{\alpha t}},1\Big) = f\Big(\frac{y}{\sqrt{\alpha t}}\Big)$$

Say $\eta=\frac{y}{\sqrt{\alpha t}}$, so $u=f(\eta)$.

For use later:

\begin{align} \frac{\partial \eta}{\partial t}=&-\frac{1}{2}\frac{y}{\sqrt{\alpha}}t^{-3/2}\\ \frac{\partial \eta}{\partial y}=&\frac{1}{\sqrt{\alpha t}}\\ \frac{\partial y^*}{\partial y}=&\frac{1}{\sqrt{\alpha t_0}}\\ \frac{\partial t^*}{\partial t}=&\frac{1}{\sqrt{t_0}}. \end{align}

For the LHS of the PDE, using the chain rule (and also using the condition $t_0=t$):

\begin{align} \frac{\partial u}{\partial t^*}=&\frac{\partial f(\eta)}{\partial \eta}\frac{\partial \eta}{\partial t}\frac{\partial t}{\partial t^*}\\ =&f'(\eta)\Big(-\frac{1}{2}\frac{y}{\sqrt{\alpha}}t^{-3/2}\Big)t_0\\ =&f'(\eta)\Big(-\frac{1}{2}\frac{y}{\sqrt{\alpha}}t^{-3/2}\Big)t\\ =&-\frac{1}{2}f'(\eta)\Big(\frac{y}{\sqrt{\alpha t}}\Big)\\ =&-\frac{1}{2}\eta f'(\eta). \end{align}

For the RHS of the PDE, a similar process is used: \begin{align} \frac{\partial}{\partial y^*}\Big(\frac{\partial u}{\partial y^*}\Big)=&\frac{\partial}{\partial \eta}\Big(\frac{\partial f(\eta)}{\partial \eta}\frac{\partial \eta}{\partial y}\frac{\partial y}{\partial y^*}\Big)\frac{\partial \eta}{\partial y}\frac{\partial y}{\partial y^*}\\ =&\frac{\partial}{\partial \eta}\Big(f'(\eta)\frac{1}{\sqrt{\alpha t}}\sqrt{\alpha t_0}\Big)\frac{1}{\sqrt{\alpha t}}\sqrt{\alpha t_0}\\ =&f''(\eta). \end{align}

Therefore

$$-\frac{1}{2}\eta f'(\eta)=f''(\eta)$$

which if you want, you can substitute $\eta$ back in to produce

$$-\frac{1}{2}\frac{y}{\sqrt{\alpha t}} f'\Big(\frac{y}{\sqrt{\alpha t}}\Big)=f''\Big(\frac{y}{\sqrt{\alpha t}}\Big)$$

as you required.

Continuing on for your question 2 for completeness, the other commenters and answer are right. Use

$$\Theta(\eta)=\frac{\partial f(\eta)}{\partial \eta}$$

to change the PDE to

$$\frac{\partial \Theta(\eta)}{\partial\eta}=-\frac{1}{2}\eta \Theta(\eta)$$

which has the solution of

$$\Theta(\eta)=Ce^{-\eta^2/4}.$$

Integrate this

$$f(\eta)=C\int_\eta^\infty e^{-\eta^2/4}d\eta$$

then change variables using $\xi^2=\eta^2/4$ and $\eta=2d\xi$ to get

$$f(\xi)=2C\int_{\eta/2}^\infty e^{-\xi^2}d\xi. \tag{\star}$$

By definition (good example here), the error function of parameter $z$ is

$$\text{erf}(z)=\frac{2}{\sqrt{\pi}}\int_{0}^z e^{-\phi^2}d\phi$$

and has the properties $\text{erf}(-z)=-\text{erf}(z)$, $\text{erf}(0)=0$, and $\text{erf}(\infty)=1$.

Using these properties, equation ($\star$) can be split up into

$$f(\xi)=2C\Bigg[\int_{0}^\infty e^{-\xi^2}d\xi-\int_{0}^{\eta/2} e^{-\xi^2}d\xi\Bigg].$$

The first integral evaluates to $\sqrt{\pi}/2\text{erf}(\infty)$, and the second integral evaluates to $\sqrt{\pi}/2\text{erf}(\eta/2)$. Using the definition of the error function complement

\begin{align} f(\xi)=&2C\frac{\sqrt{\pi}}{2}\Big[1-\text{erf}(\eta/2)\Big]\\ =&C\sqrt{\pi}\text{erfc}(\eta/2) \end{align}

Then apply your boundary conditions and find constant $C$. I attempted this but got some unexpected results. I believe your boundary conditions may be incorrect; if $f\rightarrow 1$ as $\eta\rightarrow \infty$, that means the value $u$ that is diffusing is non-zero at $y=\infty$. A much more reasonable condition is $f\rightarrow 0$ as $\eta\rightarrow \infty$. In addition the other boundary condition may be incorrect; $f(0)=0$ means that $u=0$ when $\eta=0$, meaning at the initial time and origin, there is no value for $u$. I'm not sure this is realistic for the system you're attempting to model. Perhaps check the boundary conditions and come back.

Finding substitution using dimensional analysis

As I mentioned in a comment, It's actually quite interesting how the substitution $\eta=\frac{y}{\sqrt{\alpha t}}$ is chosen. Most of the time is seems they are just pulled out of someone's imagination, but you can derive it using dimensional analysis.

This is part of a method called the Buckingham Pi theorem, which is explained really well in the book "Scaling" by G.I Barenblatt. The first part of the work is already done, where you choose a non-dimensionalisation factor for $T$. I'll call it $\Pi$ where you called it $u$, to be consistent with the original theorem

$$\Pi = \frac{T-T_w}{T_i-T_w}.$$

Then list the other variables in the system and note down their dimensions. For this I'm assuming $T$ is some scalar, like temperature (with dimension symbol $\Theta$).

\begin{align} [T]=&\Theta\\ [T_w]=&\Theta\\ [T_i]=&\Theta\\ [\alpha]=&L^2T^{-1}\\ [y]=&L\\ [t]=&T \end{align}

Note that (when grouping all the temperatures together) there are 4 variables but only 3 units between them: $\Theta,T,L$. Now partition the variables into two groups, variables with independent dimensions, and variables who's dimensions can be expressed in terms of the dimensions of the variables with independent dimensions. In this case, the variables with independent dimensions can be chosen to be $T,\alpha,t$.

If we look at $y$, which is one of our variables who's dimensions can be expressed in terms of the dimensions of the variables with independent dimensions, we can see that

$$[y]=[T]^{p_0}[\alpha]^{p_1}[t]^{p_2}.$$

Through deduction, $p_0=0$, $p_1=\frac{1}{2}$, and $p_2=\frac{1}{2}$. Therefore

$$[y]=[\alpha]^{1/2}[t]^{1/2}$$

and we can define a non-dimensional parameter

$$\Pi_1=\frac{y}{\alpha^{1/2}t^{1/2}}.$$

Then using the Buckingham Pi theorem (quoted from "Scaling", Barenblatt, 2003):

... a physical relationship between some dimensional (generally speaking) quantity and several dimensional governing parameters can be rewritten as a relationship between a dimensionless parameter and several dimensionless products of the governing parameters; the number of dimensionless products is equal to the total number of governing parameters minus the number of governing parameters with independent dimensions.

Recall that we have 4 variables, and 3 variables with independent dimensions. But since we use the non-dimensional version of $T$ this removes it from the relationship (from $4$ to $3$), so $3-3=0$ dimensionless products are needed to represent the relationship. So $\Pi$ is written as purely the dimensionless parameter, which is a function of $\Pi_1$

$$\Pi=f(\Pi_1).$$

Going back to our original notation, the substitution parameter is revealed

$$u=f\Big(\frac{y}{\sqrt{\alpha t}}\Big).$$

I hope that was understandable. The actual proof of the Buckingham Pi theorem is not the hardest to understand, but it's pretty long. I really recommend reading "Scaling" for the proof, especially if you're studying physics. It's amazing how it's possible to reduce the complexity of physical relations to only a few parameters.

• Ah. That is the way how to get rid of the extra $t$ as a factor in my derivative. – mrtaurho Jul 24 '18 at 21:38
• It's actually quite interesting how the substitution $\eta=\frac{y}{\sqrt{\alpha t}}$ is chosen. Most of the time is seems they are just pulled out of someone's imagination, but you can derive it using dimensional analysis. If you want, I can go through it and add it to my answer above. – WilliamMorris Jul 24 '18 at 21:43
• I would be interested in it and I guess the originial questioner too. – mrtaurho Jul 24 '18 at 21:46
• @WilliamMorris Yes please. I am carefully reading your answer to ensure that I understand everything. – The Pointer Jul 24 '18 at 21:55
• Wow!!!! This answer looks AMAZING!!! Thank you so much! I will finish reading it once I get home. – The Pointer Jul 25 '18 at 0:20

I guess the answer to your first question lies in the fact that the function $f(x)$ is closely connected with the errorfunction as you can see in the end of your calculations. Therefore consider

$$f'\left(\frac{y}{\sqrt{\alpha t}}\right)~=~e^{\large-\frac{y^2}{4\sqrt{\alpha t}}}$$

Differentiate with respect to $y$ gives us

$$f''\left(\frac{y}{\sqrt{\alpha t}}\right)~=~\frac{\partial}{\partial y}\left(e^{\large-\frac{y^2}{4\sqrt{\alpha t}}}\right)~=~-\frac12\frac{y}{\sqrt{\alpha t}}e^{\large-\frac{y^2}{4\sqrt{\alpha t}}}~=~-\frac12\frac{y}{\sqrt{\alpha t}}f'\left(\frac{y}{\sqrt{\alpha t}}\right)~$$

which is the substitution which was used.

For your second question I would suggest the substitution $f'(\eta)=y(\eta)$ and respectively $f''(\eta)=y'(\eta)$. From there on we will get a quite easy ODE to solve which gives leads us to $y(\eta)~=~C e^{-\frac{\eta^2}{4}}$ and from there on you can compute $f(\eta)$ by integrating.

• Thank you for taking the time to post this answer. With regards to my first question, I think what you did is different from the author of the example: if I'm understanding your answer correctly, then you already knew that $f'\left(\frac{y}{\sqrt{\alpha t}}\right)~=~e^{\large-\frac{y^2}{4\sqrt{\alpha t}}}$. What I'm asking is how did the author do it? When the author says "Substitute this into the PDE to get an ODE", what did he do to derive $\dfrac{-1}{2} \dfrac{y}{\sqrt{\alpha t}} f'\left( \dfrac{y}{\sqrt{\alpha t}} \right) = f''\left( \dfrac{y}{\sqrt{\alpha t}} \right)$? – The Pointer Jul 24 '18 at 20:38
• Actually I am not sure. But I guess you can use the fact that, as far as I know, the errorfunction is the only function out there which satisfies this given relation between derivates of the function itself. So I think the author already was familiar with these kinds of problems and just remembers this fact when he first saw this equation. Just as a kind of mathematical intuition, but I do not know it exactly to be honest. – mrtaurho Jul 24 '18 at 20:42
• Oh, ok. Because I was looking at this example and thinking "how did we get from there to $\dfrac{-1}{2} \dfrac{y}{\sqrt{\alpha t}} f'\left( \dfrac{y}{\sqrt{\alpha t}} \right) = f''\left( \dfrac{y}{\sqrt{\alpha t}} \right)$? What does the author mean by substitute?" But, according to you, it seems that the author used their prior knowledge? I mean, if you don't understand that part of the example either, then it might be that the author left something out, rather than me misunderstanding something. Or perhaps someone else can see what's going on here. – The Pointer Jul 24 '18 at 20:45
• In general this ODE solver (wolframalpha.com/widgets/…) suggest $c_1 \sqrt{\pi} \operatorname{erf} \left( \frac{x}{2}\right) + c_2$ for your given ODE. You are welcome. I am pleased if I could help you. – mrtaurho Jul 24 '18 at 20:47
• Hmm, isn't this different from the example solution? The example has $f(\eta) = \sqrt{\pi}$, but yours also multiplies that by the error function of $\dfrac{x}{2}$? – The Pointer Jul 24 '18 at 20:50