# Cube cooling Fourier series coefficients

I wanted to solve a heat equation for cube which has initial temperature of $$100°C$$ and is cooling to the temperature of $$20°C$$.

I calculated heat equation and I wanted get the coefficients $$a_{n,m,l}$$.

The conditions are $$T(x,y,z,t)=20$$ for all $$(x,y,z)$$ on the boundary of the cube and all $$t > 0$$ and $$T(x,y,z,0)=100$$ for all $$(x,y,z)$$ inside the cube. The equation which I tried to solve:

$$\frac{\partial T}{\partial t} = \alpha \left(\frac{\partial^2 T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2} + \frac{\partial^2 T}{\partial z^2} \right)$$

The function I got

$$T(x,y,z,t) = 20 + \sum_{n=1}^{\infty} \sum_{m=1}^{\infty} \sum_{l=1}^{\infty} a_{n,m,l} \sin\left(\frac{n \pi x}{a}\right) \sin\left(\frac{m \pi y}{a}\right) \sin\left(\frac{l \pi x}{a}\right) e^{-\alpha^2 \lambda_{n,m,l} t}$$

I calculated

$$a_{n,m,l} = \frac{8}{a^3} \int_{0}^a \int_{0}^a \int_{0}^a 80 \sin\left(\frac{n \pi x}{a}\right)\sin\left(\frac{m \pi y}{a}\right) \sin\left(\frac{l \pi x}{a}\right) dx \;dy \;dz \\ = -\frac{2560 \;sin^2\left(\frac{n \pi}{2}\right) sin^2\left(\frac{m \pi}{2}\right) (1-cos(\pi l))}{\pi^3 n m l} = \\ = 80 \left(\frac{2}{\pi}\right)^3 \frac{1}{nml} (1-(-1)^n)(1-(-1)^m)(1-(-1)^l)$$

But it seems not right. I don't know how to determine the right Fourier coefficient. I get this:

Thank you for help. I get this

• You have no boundary conditions: $T(x,y,z,t)=20$ simply means that $T=20$ for all $x,y\text{ and }z$ and for all of time. You need three BCs: one for $x$, one for $y$ one for $z$. W/o these your problem is ill-posed.
– Gert
Apr 23 at 23:37
• @Gert I explain the initial conditions. Apr 23 at 23:43
• You have a PDE, second order and in three dimensions (plus time). That means you need an initial condition (which you have) and TWO BCs per dimension, in order to be able to determine all integration constants (there are six of them).
– Gert
Apr 23 at 23:46
• I've corrected conditions for $x,y,z$, are they enough to find $T(x,y,z,t)$? Apr 23 at 23:56
• Yes, I'll formulate an answer now
– Gert
Apr 23 at 23:59

Your boundary conditions (BC) are better formulated as: $$T(0,y,z,t)=T(a,y,z,t)=20$$ $$T(x,0,z,t)=T(x,a,z,t)=20$$ $$T(x,y,0,t)=T(x,y,a,t)=20$$ Such BC are called 'non-homogeneous' and very difficult to handle.

But there's a 'cheap-and-easy' remedy: transform the dependent variable $$T$$ to:

$$u=T-20$$ The new boundary conditions in $$u$$ are now homogeneous, because: $$u(0,y,z,t)=u(a,y,z,t)=0$$ $$u(x,0,z,t)=u(x,a,z,t)=0$$ $$u(x,y,0,t)=u(x,y,a,t)=0$$

All your derivatives remain the same because $$20$$ is a constant and derives to $$0$$.

The new PDE is now:

$$\frac{\partial u}{\partial t} = \alpha \left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2} \right)$$

Now you solve this PDE with the new, homogeneous BCs (the IC becomes $$u(x,y,z,0)=80$$) and when you're done you apply:

$$T(x,y,z,t)=20+u(x,y,z,t)$$

That's where your mystery constant come from.