# Laplace's heat equation equilibrium functions

I simulated the Laplace's heat equation on a grid (200x200) with boundary conditions of 0 (a cold source) on the top and left and 1 (of hot source) on the bottom and right. (see gif)

I stopped iterating more on the time because I obtain kind of an equilibrium. Do we know to which functions it converges ? It looks like a bit of x^2 and sqrt(x) between 0 and 1.

I'm looking for these functions: The pure final step image looks like this (t = 39500) Using wolframalpha, I find an quadratic approximation for the cold equilibrium : -0.00327*x^2 + 1.64*x + 2.42 it gives: Do we have a precise equation?

• What exactly are your boundry conditions along the edges? Do you have a fixed temperature along each edge or does it vary smoothly from the bottom right to top left? Or do you have some other condition? – By Symmetry Nov 10 '18 at 1:24
• I have a permanent source of heat (=1) at the right and bottom and a permanent source of cold (=0) at the top and left. That's why we have an equilibrium because if we didn't have the cold source at the top, the heat would have spread all over the grid – Romain B. Nov 10 '18 at 1:31
• You have a function value 0 at the grid point at the top left corner and function value of 1 at the grid point at the bottom right corner? Is the region square? – Chet Miller Nov 10 '18 at 2:21
• This is the discretized heat equation where the value of the point (i,j) on the 2D grid at the time t+1 is the mean value of the 4 neighbors at time t. I just have constant value on the edges to simulate a constant source of heat/cold – Romain B. Nov 10 '18 at 2:31

Your iterations are converging to a solution of Laplace's equation, $$\nabla^2T(x,y)=0$$, with your boundary conditions. This equation can be solved exactly in a rectangular area, with $$T$$ being arbitrary specified functions along the borders. The solution technique produces an infinite series, as shown here:

http://ramanujan.math.trinity.edu/rdaileda/teach/s12/m3357/lectures/lecture_3_6_short.pdf

If we take your grid to be the unit square $$0 \le x \le 1$$, $$0 \le y \le 1$$, then a solution which has $$T=0$$ along the bottom, left, and right and $$T=1$$ at the top is the one derived in the PDF, which is

$$f(x,y)=2\sum_{n=1}^\infty\frac{1-(-1)^n}{n \pi \sinh{n \pi}}\sin{n \pi x}\sinh{n \pi y}$$

It looks like this: The contour lines show $$T=0.1, 0.2, … 0.9$$. Of course the temperature varies smoothly between the contours; the constant colors are just how Mathematica does contour plots by default.

The solution you want, with $$T=0$$ along the left and top and $$T=1$$ along the right and bottom is the superposition

$$T(x,y)=f(y,x)+f(x,1-y)$$

and looks like this: Here is a version with continuous shading: As far as I know, the infinite sum cannot be summed to produce a simpler form for the solution, and there is no simple equation for the contour lines (except for the obvious one along the diagonal). However, using the exact solution you could calculate the points on any contour line numerically.

• How can you compute this infinite serie ? Do we stop summing when the added term is small enough ? – Romain B. Nov 10 '18 at 11:45
• Yes. For large $u$, $\sinh{u}$ behaves like $e^u/2$. So for large $n$ the terms in $f(x, y)$ decrease exponentially like $e^{-\pi(1-y)n}$. – G. Smith Nov 10 '18 at 18:13
• I produced the plots by keeping the first 100 terms. – G. Smith Nov 10 '18 at 18:16