3

This is a follow-up to my previous question, as I try to understand how to solve the differential equation under less conventional boundaries.

Consider a finite diffusion in the boundary of $0 < x < l$ where $l$ is a rigid wall (the diffusing species do to pass through).

$$\frac{\partial c}{\partial t} = D\frac{\partial^2c}{\partial x^2}$$ with boundary conditions of:

$c(0,t) = A$

$c(l,t) = 0$

$c(x,0) = 0 \quad (l > x > 0)$

How can we solve it with the condition that causes the concentration to increase by $t$ at $x=l$.

Example: $c(0,t)=A$ is the concentration at the membrane. $l$ is a rigid wall, and the concentration increases by time. enter image description here

I believe the concentration profile should be something like enter image description here

Kama
  • 121
  • What do you mean when you say "with the condition that causes the concentration to increase by $t$ at $x=l$"? Do you mean $c(l, t) = t$? If so, this conflicts with your other boundary condition, which says $c(l,t) = 0$. – John Barber Aug 29 '17 at 00:00
  • @JohnBarber: Yeah, it does not make sense. I just ignored it. He might mean to say $c(x,t)$ increases with $t$ at $x\in(0,l)$. – Hans Aug 29 '17 at 00:12
  • @JohnBarber: What do you think of my answer below? – Hans Aug 29 '17 at 06:46
  • @JohnBarber This means that $l$ is a rigid wall and the diffusing species does not pass through. It is the opposite of the common boundary condition of $c(\infty,t)=0$. – Kama Aug 29 '17 at 07:49
  • 1
    If the diffusing species reflects on the wall, the normal condition would be a homogeneous Neumann condition $\frac{\partial c}{\partial x}(l, t) = 0$. – Gribouillis Aug 29 '17 at 08:58
  • 1
    The lecture slides from this site especially the 1-D heat equation part 1 give explicit solutions for the heat equation on a rod. In your case a trick is to solve in an interval $[0, 2L]$ with the condition $c = A$ on both boundaries and $c=0$ initially. The solution will have $c=A$ at $x=0$ and $\frac{\partial c}{\partial x} = 0$ at $x=L$ because it will be symetric with respect to $x=L$. You can define $c(x, t) = A - u(x,t)$ and $u$ satisfies $u=0$ when $x =0 or L$ and $u=A$ at $t=0$. The slides give the solution. – Gribouillis Aug 29 '17 at 10:46
  • @Kama: Are you accepting Gribouillis' suggestion of the Neumann boundary condition? If so, you should change your question accordingly. – Hans Aug 29 '17 at 17:59
  • @Hans I believe it is Neumann at $x=l$ but I think $x=0$ is Dirichlet. – Kama Aug 30 '17 at 08:03
  • Kama: That is what I meant. It would better change the boundary condition of your question to your intended one. My answer is for your original boundary condition. The basic solving idea is the same for the new boundary condition. Do you want me to write up the solution to the new boundary condition? Or are you now able to solve it by yourself? – Hans Aug 30 '17 at 16:17
  • @Hans I am still confused. I think the boundary conditions for the figures I added are the same as the original ones written in the question. $c(0,t)=A$ (the concentration behind the membrane) and $c(x,t)=0, 0<x<l$. Your answer assumes that there is a linear gradient between $x$ and $l$ at $t=0$, which is not the case. – Kama Aug 31 '17 at 02:40
  • Your description is very confusing. Are you saying you want to leave the boundary condition $c(l,t)=0$ as it is instead of $\frac{\partial c}{\partial x}(l,t)=0$? Also you probably have a typo writing $c(x,t)=0$ instead of $c(x,0)=0$ which satisfies your figure. My answer assumes nothing but $c(x,0)=0$. It is that $c_0$ and $c_1$ have linear gradient at $t=0$ which are specifically designed to cancel each other, not the sum of them which is $c$ and vanishes. – Hans Aug 31 '17 at 03:15
  • @Hans sorry for my confusing description. Just consider the figures, as they should be less confusing. I mean there is no species in the system at $t=0$. I meant the concentration behind the membrane. I think the boundary conditions should be $c(0,0)=0$ and $c(0,t)=A$ – Kama Aug 31 '17 at 04:41
  • Your formulation is incomplete. Have you looked my comment regarding the condition $\frac{\partial c}{\partial x}(l,t)=0$? I think that is what you need as it matches your figure. You should change your formulation of the boundary condition. Your condition $c(l,t)=0$ contradicts your figure. – Hans Aug 31 '17 at 06:05
  • @Hans yes $\frac{\partial c}{\partial x}(l,t)=0$. Why the condition $c(l,t)=0$ contradicts the figure? The figure is for $t>0$. At $t=0$ the $c$ can be 0. – Kama Aug 31 '17 at 07:47
  • $c(l,t)=0$ means the function is $0$ at $x=l$ for all $t>0$, whereas your figure shows $c(l,t)>0$ for all $t>0$. Is that not a contradiction? – Hans Aug 31 '17 at 18:59

1 Answers1

1

Note: The following answer is based on the boundary condition originally given by OP, namely \begin{align} c_0(0,t)&=A, \\ c_0(1,t)&=0, \\ c_0(x,0) &= 0\ \forall l>x>0. \end{align} The OP may change the boundary condition to a Neumann one. Should that happen, there will be a new solution. The basis idea will remain the same though.


WLOG, let $D=\frac12$, $A=1$ and $l=1$. Otherwise, you can always scale to these numbers.

By linearity of the diffusion equation, the final solution is the linear superposition of two functions $c_1(x,t)$ and $c_0(x,t)$ each being the diffusion equation solution of two sets of boundary conditions.
\begin{align} c_1(0,t)&=c_1(1,t)=0 \\ c_1(x,0) &= x-1 \end{align} and the solution for boundary condition \begin{align} c_0(0,t)&=1 \\ c_0(1,t)&=0 \\ c_0(x,0) &= 1-x \end{align} The latter solution is simply $c_0(x,t)=1-x$.

To obtain the first solution, we expand the domain to the whole real line and let the initial condition $c(x,0)$ be a periodic function of period $2$ and $$c_1(x,0)=x-1,\ x\in(0,2].$$ Now the solution is $$c_1(x,t) = \sum_{n=-\infty}^\infty\frac1{\sqrt{2\pi t}}\int_0^2e^{-\frac{(y-x-2n)^2}{t}}(y-1)\,dy.$$ It is clear that $c_1(x,t)$ satisfies the given boundary condition since it is an odd function with respect to $x=0$ and $x=1$. You should be able to take it over from here, making some simplifications. The final solution is an infinite series with terms involving exponentials and error functions.

The final solution is just the sum of the two solutions above $$c(x,t)=c_0(x,t)+c_1(x,t).$$

Hans
  • 9,804
  • The boundary conditions says $c(x,0)=0$. How did you interpret it as $c(x,0)=x-1$? – Googlebot Aug 29 '17 at 07:19
  • @All: I have edited my answer so as to add a subscript to $c$ for clarity. That $c$ is now $c_1$. It is a component of the final solution $c$. Namely, $c=c_0+c_1$ as indicated in my edited answer. I am just decomposing $c$ into two components $c_0$ and $c_1$. Since the initial condition of $c_0$ is set to be $1-x$, the initial condition of $c_1$ has to be its negative or $x-1$ in order for the initial condition of $c$ to be $0$. Let me know whether this is clear or not. – Hans Aug 29 '17 at 08:37
  • @All: The motivation for setting this $c_0$ is to make $c_1(0,t)=c_1(1,t)=0$. – Hans Aug 29 '17 at 08:59