A heated plate¶
The temperature of a square plate with three cold sides and a fourth that is heated in its middle.
import sympy as sp
import pdemagic as pm
x, y = sp.symbols("x y", real=True)
T = sp.Function("T")(x, y)
plate = pm.Box({x: (0, 1), y: (0, 1)})
walls = dict.fromkeys(plate.faces, sp.Eq(T, 0))
walls[y, 1] = sp.Eq(T, sp.sin(sp.pi * x) ** 4)
heated = pm.Problem(sp.Eq(pm.laplacian(T), 0), domain=plate, boundary=walls)
pm.solve(heated).plot()
What it shows¶
Laplace’s equation on a box with walls: heat that has settled. Each face of the box takes its own condition, here the value of the temperature. Three faces are kept at zero, and the face \(y = 1\) is hot in its middle and cold at its ends, where it meets its neighbours. The heat spreads into the plate and fades with the distance from the hot face: in the middle of the plate the temperature is 0.14.
What pdemagic decided¶
The planner chose collocation at Chebyshev points (collocation), which
include the faces and crowd towards them. It solved on one grid after
the other and took the coarsest on which the solution and what is
given on the faces are resolved to \(10^{-10}\): 64 by 64 points.