# Thread: Help with Heat Equation with nonhomogeneous boundary conditions

1. ## Help with Heat Equation with nonhomogeneous boundary conditions

So I'm not sure how to start on this problem.

$u_{t} = u_{xx} +1$
$u(0,t) = 1 ; u_{x}(1,t) = 0$
$u(x,0)=1$

$t>0; 0

Where im having my difficulty is finding the steady state solution.

$v''(x) = -\frac{1}{\beta}P(x)$ with P(x) =1

Where do I go from here?

2. If you want steay state (i.e. $t \to \infty$) then solve

$u_{xx} + 1 = 0$ subject to your BC's.

3. The steady state solution depends only on x s(x).
Inserting we get

$
s_{xx}=-1
$

$
s(0)=1 \; and \; s_x(1)=0.
$

Then we find the solution

$
u(x,t)=s(x)+v(x,t)
$

defining initial and boundary conditions to v(x,t).

4. $r^2=-1$

$r = \pm i$

$s(x) = c_{1}\cos{x} +c_{2}\sin{x}$

$s'(x) = -c_{1}\sin{x} +c_{2}\cos{x}$

$s(0) = 1 ; s'(1)=0$

so

$1 = c_{1}\cos{0} +c_{2}\sin{0}$

so

$c_{1} = 1$

$0 = -\sin{1} +c_{2}\cos{1}$

$\sin{1} = c_{2}\cos{1}$

$\tan{1} = c_{2}$

$s(x) = \cos(x) +\tan(1)\sin{x}$

5. What would be my next step?

$v_{t} = \beta v_{xx}$

$v(0,t) = 0; v_{x}(1,t) = 0$

$v(x,0) = 1- s(x)$

Separation of variables?

$v(x,t) = X(x)T(t)$

$X''(x) - KX(x) = 0$

$T'(t) - \beta KT(t) = 0$

Case 1 -- K=0

$X(x)= C_{1}x+C_{2}$

using boundary condtions I got

$0 = C_{1} = C_{2}$

so there exist no nontrivial solution

Case 2 --- K > 0

$X(x) = C_{1}e^{\sqrt{K}x} +C_{2}e^{-\sqrt{K}x}$

using boundary conditions also produces nontrivial solutions.

$0 = C_{1} = C_{2}$

Case 3 ---- K < 0

$X(x) = C_{1}\cos{\sqrt{-K}x} + C_{2}\sin{\sqrt{-K}x}$

and

$X'(x) = -C_{1}\sqrt{-K}\sin{\sqrt{-K}x} + C_{2}\sqrt{-K}\cos{\sqrt{-K}x}$

and this is where I run into problems again

$0 = C_1$

which just leaves me with

$0 = C_{2}\sqrt{-K}\cos{\sqrt{-K}}$

so my question is if

$C_2 = 0$

$\cos{\sqrt{-K}} = \cos{\frac{(2n+1)\pi}{2}}$ for n = 0,1,2,3,...

$K = - \frac{(2n+1)^2 {\pi}^2}{4}$

my question is what does

$\sqrt{-K} = 0$

have?

Can I just consider that a nontrivial solution with $C_2 = 0$?

And am I approaching the problem correctly so far? Thanks in advance

6. My last step to finishing if everything is correct is to

$v(x,t) = \sum_{n = 0}^{\infty} c_n e^{(- \frac{(2n+1)^2 {\pi}^2}{4})t}\sin{\frac{(2n+1)\pi x}{2}}$

$1 - (\cos(x) +\tan(1)\sin{x}) = c_n \sin{\frac{(2n+1)\pi x}{2}}$

which then gives me

$u(x,t) = s(x) + v(x,t)$

7. Originally Posted by 11rdc11
$r^2=-1$

$r = \pm i$

$s(x) = c_{1}\cos{x} +c_{2}\sin{x}$

$s'(x) = -c_{1}\sin{x} +c_{2}\cos{x}$

$s(0) = 1 ; s'(1)=0$

so

$1 = c_{1}\cos{0} +c_{2}\sin{0}$

so

$c_{1} = 1$

$0 = -\sin{1} +c_{2}\cos{1}$

$\sin{1} = c_{2}\cos{1}$

$\tan{1} = c_{2}$

$s(x) = \cos(x) +\tan(1)\sin{x}$
Look at the ODE again. What you solved was $s_{xx} + s = 0$.

8. Thanks Danny,

So the correct

$s(x) = 1 + x - \frac{x^2}{2}$

so

$1-(1 + x - \frac{x^2}{2}) = c_n \sin{\frac{(2n+1)\pi x}{2}}$

Now im not sure how to finish up. Don't know how to attempt a fourier series with the term $\sin{\frac{(2n+1)\pi x}{2}}$

Do I just do the same as when I'm dealing with with $\sin{\frac{n\pi x}{L}}$?

$c_n = \frac{2}{L} \int_{0}^{L}f(x)\sin{\frac{n\pi x}{L}}$

$c_n = \frac{2}{L} \int_{0}^{L}f(x)\sin{\frac{(2n+1)\pi x}{2L}}$

$u_t = u_{xx} + 1$

$u(0,t) = 1, u_x(1,t) = 0, u(x,0) = 1$.

The first boundary condition is a problem so we'll change this problem into a new (do-able) problem.

Let $u = v + ax + b$ and choose $a$ and $b$ such that the new problem is

$v_t = v_{xx} + 1$

$v(0,t) = 0, v_x(1,t) = 0, v(x,0) = ?$

Without the source term ( $Q = 1$), separation of a variables would lead to what you have

$\displaystyle v(x,t) = \sum_{n = 0}^{\infty} c_n e^{(- \frac{(2n+1)^2 {\pi}^2}{4})t}$ $\; \sin{\frac{(2n+1)\pi x}{2}}$

Hence we look for a solution of the form

$\displaystyle v(x,t) = \sum_{n = 0}^{\infty} T_n(t) \sin$ ${\frac{(2n+1)\pi x}{2}}$

noting that we'll need a Fourier series of the form

$\sum_{n = 0}^{\infty} q_n \sin{\frac{(2n+1)\pi x}{2}}$

for the source term $Q = 1$

PS. Yes on

$c_n = \frac{2}{L} \int_{0}^{L}f(x)\sin{\frac{(2n+1)\pi x}{2L}}$