๐ง Example: Laplace equation
$$ \nabla^2 \phi=0 $$
Consider a box of sides $L$ with 3 sides with $\phi=0$ and the remaining side $\phi=V$
The edge potentials correspond to the boundary conditions
We are working in 2-D
To find the potential $\phi(x,y)$ we need to solve
$$ \frac{\partial^2 \phi}{\partial x^2}+ \frac{\partial^2 \phi}{\partial y^2}=0 $$
The boundary conditions are
$$ \begin{aligned} \phi(x,0)&= \phi(x,L)=\phi(0,y)=0\\ \phi(L,y)&=V \end{aligned} $$
the last conditions is holding the right plate at $\phi=V$
separation of variables
$$ \frac{1}{X}\frac{\text d^2 X}{\text dx^2}+\frac{1}{Y}\frac{\text d^2 y}{\text d y^2}=0 $$
both terms are equal to the same and opposite constant so we can write
$$ \begin{aligned} \frac{1}{X}\frac{\text d^2 X}{\text dx^2}&=k^2 \\ \frac{1}{Y}\frac{\text d^2 Y}{\text dx^2}&=-k^2 \end{aligned} $$
๐๏ธ Note: the PDE became an ODE
Start by solving for $Y$
Assume the solution is a sum of sines and cosines
$$ Y(y)=A\cos(ky)+B\sin(ky) $$
We apply the boundary conditions
$$ \begin{aligned} Y(0)&=A=0 \\ Y(L)&=B\sin(kL)=0 \end{aligned} $$
The second equation is satisfied by
$$ k=\frac{n\pi}{L}=k_n $$
Thus there is no cosine term and constrain the value of $k$
Solve for $X$
The ODE for X can be solved in terms of exponentials
$$ X(x)=A_n\exp(k_n x)+ B_n\exp(-k_nx) $$
we solve for $\phi=XY$ and we sum over all possible excitations
$$ \phi(x,y)=\sum^\infin_{n=1} \sin \left ( \frac{n\pi y}{L}\right )\,\left [ A_n \exp\left ( \frac{n\pi x}{L} \right )+B_n\exp \left( -\frac{n\pi x}{L} \right ) \right ] $$
Applying boundary conditions
$$ \phi(0,y)=\sum_n^\infin (A_n+ B_n) \,\sin \left ( \frac{n\pi y}{L}\right )=0 $$
This requires $B_n=-A_n$ and hence $X$ becomes
$$ X_n=2A_n\sinh \left ( \frac{n\pi y}{L} \right ) $$
this ensures the boundary condition at $x=0$ is satisfied
We apply the boundary condition at $y=L$
$$ \phi(L,y)=\sum_n^\infin 2A_n\sinh(n\pi)\sin\left (\frac{n\pi y}{L} \right )=V $$
We can try multiplying by $\sin\left ( \frac{m\pi y}{L} \right )$ and integrating of all $y$ which corresponds to the box $0\to L$ the orthogonality of sine functions give
$$ \int^L_0\sin\left ( \frac{m\pi y}{L} \right )\sin\left ( \frac{n\pi y}{L} \right )\,\text dy=\left \{ \begin{matrix} 0 & \text{if} & m\ne n \\ \frac{L}{2} & \text{if} & m=n \end{matrix}\right . $$
From this we get the following:
$$ \begin{aligned} 2A_n\sinh(n\pi)\frac{L}{2}&=\int^L_0 V\sin\left ( \frac{n\pi y}{L} \right ) \,\text dy\\ &=\frac{VL}{n\pi}\left [ -\cos \left ( \frac{n\pi y}{L} \right ) \right ] \\ &=\frac{VL}{n\pi}[1-\cos(n\pi)] \end{aligned} $$
Now we get a valye of $A_n$
$$ A_n=\frac{V}{\pi}\frac{1}{n\sinh(n\pi)}(1+(-1)^{n+1}) $$
We thus get the final solution of
$$ \phi(x,y)=\frac{4V}{\pi}\sum_{\text{odd }n} \frac{1}{n\sinh(n\pi)}\sinh\left ( \frac{n\pi x}{L} \right )\sin\left ( \frac{n\pi y}{L} \right ) $$
$$ \nabla^2 T=\frac{1}{\alpha^2}\frac{\partial T}{\partial t} $$
๐๏ธ Note: here $T$ can refer to the temperature in a region or the density of the particles as they diffuse
๐ผ Case: lets derive this expression for heat flowing in one dimension
Consider a uniform rod of density $\rho$ of length $L$ with non uniform temperature lying on the $x$-axis from $x=0$ to $x=L$, specific heat $C$ and thermal conductivity $K$ and area $A$
We start with heat energy and Fourierโs law of heat
$$ Q=cmT \qquad \dot Q\frac{1}{A}=-K\frac{\partial T}{\partial x} $$
$c$ is the specific heat capacity. $m$ is the body mass, $T$ is the temperature, $\dot Q$ is the time derivative of the heat, $K$ is the thermal conductivity and $A$ is the cross-sectional area