# Applying boundary condition on heat equation

1. Apr 16, 2013

### Guffie

1. The problem statement, all variables and given/known data
hey, i have a heat equation question which asks to solve for u(x,t) given that u(0,t)=Q_0 + ΔQsin(ωt).

2. Relevant equations

d_xx u = k d_t u

u(0,t)=Q_0 + ΔQsin(ωt)

3. The attempt at a solution

so you can solve the equation pretty easily with separation of variables, i.e. u(x,t) = X(x) T(t)

then you get something like

u(x,t) = (Fcos(βx)+Gsin(βx))e^(-tkβ^2)

where β = X''/X = T'/kT

but the problem is, when you apply the b.c. you get

u(0,t) = F e^(-tkβ^2) = Q_0 + ΔQsin(ωt)

i dont see how from this i can get a value for F or β,
kβ^2 must be a positive real number to assure a physically correct expression (i.e. that u -> 0 as t-> ∞)

is there some trick that i am not seeing, or maybe more information is required?

just noticed, u(0,0) = A = Q_0

so

u(0,t) =Q_0 e^(-tkβ^2) = Q_0 + ΔQsin(ωt)

which doesn't help very much

Last edited: Apr 16, 2013
2. Apr 16, 2013

### Staff: Mentor

Are you sure that the separation of variables works?
I think you need some weird u(x,t) to get endless oscillations of u(x=0).

3. Apr 16, 2013

### HallsofIvy

Staff Emeritus
Separation of variables certainly will work when the domain of definition, in x, is an interval. But that raises the question, were you not given any boundary conditions? The solutions for a finite interval and an infinite interval are very different.

4. Apr 16, 2013

### Guffie

the only conditions are that
u(0,t)=Q_0 + ΔQsin(ωt)
and its a semi-infinite rod

is there a way to get the solution to the T equation in terms of complex numbers?

T' + kβ^2T = 0

if you treat k as a complex number?

you get

u(x,t) = (Fcos(βx)+Gsin(βx))(cos(kβ^2 t) - i sin(k β^2 t))

the closest you can get is, since F = Q_0, and if you let k be proportional to β as in k = a/β

(Q_0 cos(βx)+Gsin(βx))(cos(aβ t) - i sin(a β t))

u(0,t)=Q_0(cos(aβ t) - i sin(a β t)) =Q_0 + ΔQsin(ωt)
ω=a β and you can kind of get a value for ΔQ bit you the cos(ω t) is still there...

I tried using β as a complex number, after realising K is a positive real number for the heat equation,
also instead of β^2 i picked iβ
so T'/T = -ikβ

then T(t) = e^(-ikβt) = cos(kβt)-isin(kβt)

but then the solution for X(x) is really ugly, it has like e^-(1)^(3/4) kind of things in it and its still not gonna give a T_0

Last edited: Apr 17, 2013
5. Apr 17, 2013

### Staff: Mentor

Oh, that condition is forced and heat propagates from there to one side. Okay, that makes sense.

As the boundary condition is periodic, I would look for a periodic solution as well. I still think that you cannot separate the whole system, but it should be possible if you subtract Q_0. The time-dependence is easy to guess then.

6. Apr 17, 2013

### Guffie

easy to guess, but im finding its not so easy to get the solution, the closest i have come is

T(t) = e^(-ikβt) = cos(kβt)-isin(kβt)

do you know how i would get rid of the i?

7. Apr 17, 2013

### HallsofIvy

Staff Emeritus
That's an awkward way of doing this problem but you do NOT have "T(t) = e^(-ikβt) = cos(kβt)-isin(kβt)"
You have, rather, that T(t) = Ce^(-ikβt) = Acos(kβt)- Bsin(kβt) for C some complex number. And the fact that all the conditions here involve only real numbers tells you that C must be such that A and B are real numbers.

8. Apr 17, 2013

### Guffie

ah i see,

but still, using this you get

u(0,t) = Acos(kβt)- Bsin(kβt) = Q_0 + ΔQsin(ωt) (ignoring the X component)

clearly B = ΔQ (pretending B includes the constants from the X solution)

but theres no way to make Acos(kβt)=Q_0

if it were evaluated at some particular t i could see how its possible, but otherwise i dont see how you can do that.

does that imply A = 0? but if you use u(0,0) =0 = Q_0 so this suggests the A isn't actually zero
seeing how you get Q_0 from these types of solutions has been another confusing thing,

also in the X solution there are two arbitrary constants, and this boundary condition is only going give like, because X(x) = some linear combination of ugly e^x... things

u(0,t)=(F+G)(Acos(kβt)+Bsin(kβt))= Q_0 + ΔQsin(ωt) so really (F+G)B=ΔQ and you have this cos term

u(0,0) = (F+G)A = Q_0

now this kind of hints A/B = Q_0/ΔQ

so ideally F+G = 1

so you'd get like, u(x,t) = (0.5 e^x.. + 0.5 e^-x..)(Q_0 cos(kβt)+ ΔQsin(kβt))

but u(0,t) = Q_0 cos(kβt)+ ΔQsin(kβt)

see what i mean?

9. Apr 17, 2013

### Staff: Mentor

B is a function of x. B(0)=ΔQ.

I would get rid of Q_0 with a linear transformation first, and work on the main problem afterwards.

With the approach HallsofIvy posted, it is possible to solve the problem in a conventional way, without any surprising steps.
The solution has interesting degrees of freedom.

Last edited: Apr 17, 2013
10. Apr 17, 2013

### Guffie

with that approach you get a cos term aswell, that's one of the main problems ive been having,

what your saying is to say the constant associated with that cos will be zero,

then i guess it would work, but you'd have to add Q_0 to the solution,

is there a way to solve the problem with hallsofivy's approach without having to add Q_0 to the solution with no proper justification, besides that it works

11. Apr 17, 2013

### Staff: Mentor

You get a cos term, but it is 0 at x=0.

Adding d+xe with constants d,e does not change the differential equation - the general solution is a sum of the solution to the heat equation (sin, cos terms) and arbitrary linear terms. You can fix the linear terms to get the right boundary conditions.

12. Apr 17, 2013

### Guffie

sorry i don't follow the first thing you said,
the cos term is cos(kβt), how is that zero at x = 0? its not zero at t = 0 either,