3 7.20m, §3 Boundary Condition Fix

To get rid of the inhomogeneous boundary conditions at $x=0$ and $x=\ell$, use the following trick:

Trick: Find any function $u_0$ that satisfies the inhomogeneous boundary conditions at $x=0$ and $x=\ell$ and substract it from $u$. The remainder, call it $v$, will have homogeneous boundary conditions.

So, we try to find a $u_0(x,t)$ that satisfies the same boundary conditions as $u(x,t)$:

\begin{displaymath}
u_{0x}(0,t)=g_0(t) \qquad u_{0}(\ell,t)=g_1(t)
\end{displaymath}

This $u_0$ does not have to satisfy the PDE nor IC, which allows us to take something simple for it.

A linear function of $x$ works:

\begin{displaymath}
u_0(x,t) = A(t) + B(t) x
\end{displaymath}

If we require this to satisfy the two boundary conditions for $u$ above, we get

\begin{displaymath}
B(t) = g_0(t) \qquad A(t)+ B(t)\ell = g_1(t)
\end{displaymath}

The solution is $B(t)=g_0(t)$ and $A(t)=g_1(t)-B(t)\ell$. So our $u_0$ is

\begin{displaymath}
\fbox{$\displaystyle
u_0(x,t) = g_1(t)+g_0(t)(x-\ell) $}
\end{displaymath}

Please keep in mind what we know, and what we do not know. Since we (supposedly) have been given functions $g_0(t)$ and $g_1(t)$, function $u_0$ is from now on a known quantity, as above. I put a box around it so that we can later find it back.

You could use something more complicated than a linear function if you like to make things difficult for yourself. Go ahead and use $A(t)
{\rm erf}(x)+B(t)J_0(x)$ if you really love to integrate error functions and Bessel functions. It will work. I prefer a linear function myself, though. (For some problems, you may need a quadratic instead of a linear function.)

Under certain conditions, there may be a better choice than a low order polynomial in $x$. If the problem has steady boundary conditions and a simple steady solution, go ahead and take $u_0$ to be that steady solution. It will work great. However, in this case the boundary conditions are not steady; we are assuming that $g_0$ and $g_1$ are arbitrary given functions of time.

Having found $u_0$, define a new unknown $v$ as the remainder when $u_0$ is substracted from $u$:

\begin{displaymath}
v \equiv u - u_0
\end{displaymath}

We now solve the problem by finding $v$. When we have found $v$, we simply add $u_0$, already known, back in to get $u$.

To do so, first, of course, we need the problem for $v$ to solve. We get it from the problem for $u$ by everywhere replacing $u$ by $u_0+v$. Let's take the picture of the problem for $u$ in front of us and start converting.

Figure 3: Heat conduction in a bar.
\begin{figure}\begin{center}
\leavevmode
\epsffile{figures/1.eps}\ \ \ \epsffile{figures/2.eps}
\end{center}\end{figure}

First take the boundary conditions at $x=0$ and $x=\ell$:

\begin{displaymath}
u_x(0,t)=g_0(t) \qquad u(\ell,t)=g_1(t)
\end{displaymath}

Replacing $u$ by $u_0+v$:

\begin{displaymath}
u_{0x}(0,t)+v_x(0,t)=g_0(t) \qquad u_{0}(\ell,t)+v(\ell,t)=g_1(t)
\end{displaymath}

But since by construction $u_{0x}(0,t)=g_0$ and $u_{0}(\ell,t)=g_1$,

\begin{displaymath}
v_x(0,t)=0 \qquad v(\ell,t)=0
\end{displaymath}

Note the big thing: while the boundary conditions for $v$ are similar to those for $u$, they are homogeneous. We will get a Sturm-Liouville problem in the $x$-direction for $v$ where we did not for $u$. That is what $u_0$ does for us.

We continue finding the rest of the problem for $v$. We replace $u$ by $u_0+v$ into the PDE $u_t=\kappa u_{xx}+q$,

\begin{displaymath}
u_{0t} + v_t = \kappa (u_{0xx} + v_{xx}) + q
\end{displaymath}

and take all $u_0$ terms to the right hand side:

\begin{displaymath}
v_t = \kappa v_{xx} + \bar q
\end{displaymath}

where $\bar q = \kappa u_{0xx} + q -u_{0t}$, or, written out

\begin{displaymath}
\fbox{$\displaystyle
\bar q(x,t) = q(x,t) - g_1'(t) - g_0'(t)(x-\ell) $}
\end{displaymath}

Hence $\bar q$ is now a known function, just like $q$.

The final part of the problem for $u$ that we have not converted yet is the initial condition. We replace $u$ by $u_0+v$ in $u(x,0)=f(x)$,

\begin{displaymath}
u_0(x,0) + v(x,0) = f(x)
\end{displaymath}

and take $u_0$ to the other side:

\begin{displaymath}
v(x,0) = \bar f(x)
\end{displaymath}

where $\bar f(x)$ is $f(x)-u_0(x,0)$, or written out:

\begin{displaymath}
\fbox{$\displaystyle
\bar f(x) = f(x) - g_1(0) - g_0(0)(x-\ell) $}
\end{displaymath}

Again, $\bar f$ is now a known function.

The problem for $v$ is now the same as the one for $u$, except that the boundary conditions are homogeneous and functions $f$ and $q$ have changed into known functions $\bar f$ and $\bar q$.

Using separation of variables, we can find the solution for $v$ in the form:

\begin{displaymath}
v(x,t) = \sum_n v_n(t) X_n(x).
\end{displaymath}

We already know how to do that! (Don't worry, we will go over the steps anyway.) Having found $v$, we will simply add $u_0$ to find the asked temperature $u$.