# Heat Equation- Constant Dirichlet and Neumann BCs

1. Dec 23, 2008

### Brainer101

Hi all,

I need to solve the heat equation (Ut=C*Uzz) with the following boundary conditions: U(max z,t)=0 and Uz(0,t)=-B. where B is a constant. My initial condition is U(z,0)=Uo where Uo is a constant.

I know how to solve the equation for simple 0 boundary conditions. The Neumann BC is especially giving me problems. If anybody knows how to solve this, or can give me a resource to solve this, it would be appreciated.

Thanks

2. Dec 25, 2008

### ice109

it's a delta function at the origin, you have to integrate around it carefully to show that the discontinuity in the derivative of the space solution is a certain finite quantity related to the value of the solution itself.

http://en.wikipedia.org/wiki/Delta_function_potential

you can adapt those methods for the heat equation

i just realized that that's U_Z that has a value at z=0. i guess the delta potential isn't even relevant. i haven't done pdes but this is a separable eqn right?

Last edited: Dec 26, 2008
3. Dec 31, 2008

### Brainer101

yes, the equation is separable.

The general solution to the equation is:
U(z,t) = e-l2t*[Dsin(l/C*z)+Ecos(l/c*z)]

D and E are functions of z. From my initial condition being constant, E=0. I know the fourier series for D to model my initial condition, and i know what l has to be. C is a pre determined constnat. So my solution has a derivative of 0, not -B. I don't know how to get the derivative to be non 0.

Thanks for any help.

4. Jan 4, 2009

### coomast

Hello Brainer, I think I have the solution to this problem. It involves the calculation of a steady-state solution and a transient one. This in order to get homogeneous boundary conditions (equal to 0). A second problem is to use the quarter range extension instead of half range as commonly done. I have just finished the calculation, but need to make sure that I did not make mistakes, so you have to give me some time to come back on this. It is late over here and I need to get up early to go to work.

To get you started try to see what happens when you set the solution to a sum of two parts, one the steady state and the other the transient. After setting the time derivative equal to zero you get the steady state solution. t will be gone and you are left with an ordinary DE in z, which is easily solved and applying the two boundary conditions gives you the steady state solution. To get the transient solution you need to adapt the boundary conditions and these will become 0 as it should.

Can you look into this? I will come back this week.

5. Jan 9, 2009

### coomast

Hello brainer101,

Sorry that it took so long to come back, it was a busy week.

I will give some info on how to obtain the solution, with intermediate
results, but the calculation itself is something you need to do by
yourself. Come back if anything is unclear.

So, the way to solve this problem is by stating that the solution
is made up of two parts, one part the steady-state and the other
the transient. This means that you need to write the solution as:

$$U(z,t)=V(z,t)+W(z,t)$$

with V(z,t) the steady-state solution and W(z,t) the transient part.
The steady-state solution is independent of time t. Thus we have V(z).

Substituting this into the original PDE gives then the following two
equations:

$$\frac{dV^2}{dz^2}=0$$
$$\frac{\partial W}{\partial t}=C \cdot \frac{\partial^2 W}{\partial t^2}$$

The first equation (steady-state) has the following boundary conditions:

$$V(L)=0$$
$$\left . \frac{dV}{dz}\right|_{z=0}=-B$$

The solution is thus:

$$V(z)=B(L-z)$$

The second equation can be solved by separation of the variables. This gives
two ODEs:

$$\frac{T'}{T}=C\frac{Z''}{Z}=\sigma$$

which is:

$$T'-\sigma T=0$$
$$Z''-\frac{\sigma}{C}Z=0$$

The boundary conditions are here now:

$$Z(L)=0$$
$$Z'(0)=0$$

Now there are three possible values for sigma, smaller, equal and larger than zero.
First let's consider zero. This gives the zero solution and must be discarded.
Secondly consider a positive value, this gives a non-bounded solution and must be discarded. Finally lets consider a negative value and set it equal to:

$$\sigma=\lambda^2$$

The equation for T gives now:

$$T(t)=K_1\cdot e^{-\lambda^2 t}$$

The one for Z is now:

$$Z''+\frac{\lambda^2}{C}Z=0$$

The solution:

$$Z(z)=K_3 cos\left(\frac{\lambda}{\sqrt{C}}z\right)$$

after applying the boundary conditions. The value for lambda is:

$$\lambda_k=\frac{\sqrt{C}}{L}(2k+1)\frac{\pi}{2}$$

and k=0,1,2,...

The total solution (transient and steady-state) is now given as:

$$U(z,t)=B(L-z)+\sum_{k=0}^{\infty}K_k\cdot e^{-\lambda^2_k t}\cdot cos\left(\frac{(2k+1)\pi z}{2L}\right)$$

At t=0 the initial condition gives:

$$U_0-B(L-z)=\sum_{k=0}^{\infty}K_k\cdot cos\left(\frac{(2k+1)\pi z}{2L}\right)$$

The coefficients Kk can be found by using a fourier series expansion by a quarter
periodic extension with odd terms.

This gives after some integrals:

$$K_k=\frac{4U_0(-1)^k}{(2k+1)\pi}-\frac{8BL}{(2k+1)^2\pi^2}$$

and the total solution is now complete.

Hopefully I didn't make any mistakes, so check this very carefully.

best regards,

coomast