Heat Transfer · Design background

Deriving and Discretizing the Fin Equation

An energy balance on a thin slice, a 2nd-order linear ODE that's exactly solvable, and a finite-difference grid that earns the right to replace it for harder geometries.

▶ Play the lab📖 Design background

1The energy balance on a slice

Take a thin slice of the fin, thickness $dx$, and balance the heat flowing in by conduction against the heat flowing out — by conduction further down the fin, and by convection off the exposed surface to the surrounding air. Dividing through by $dx$ and letting it shrink to zero gives:

$$ \frac{d^2\theta}{dx^2} - m^2\theta = 0, \qquad m^2=\frac{hP}{kA}, \qquad \theta(x)=T(x)-T_\infty $$

$P$ is the perimeter (where convection happens) and $A$ is the cross-sectional area (where conduction happens) — their ratio, scaled by $h/k$, is what sets $m$, the rate at which the fin "forgets" the base temperature as you move away from it.

2Two tip conditions, two closed-form answers

This ODE is linear with constant coefficients, so it's solved by $\theta=c_1e^{mx}+c_2e^{-mx}$ (or equivalently $\cosh$/$\sinh$). The base condition is always the same — $\theta(0)=\theta_b=T_{base}-T_\infty$ — but the tip can be modeled two ways:

Tip conditionSolution
Insulated (no heat loss at the very end)$\theta(x)=\theta_b\dfrac{\cosh(m(L-x))}{\cosh(mL)}$
Convective (tip also loses heat to air)$\theta(x)=\theta_b\dfrac{\cosh(m(L-x))+\frac{h}{mk}\sinh(m(L-x))}{\cosh(mL)+\frac{h}{mk}\sinh(mL)}$

Both are exact — the choice is about which physical assumption matches your fin, not about which is "more correct" in general.

3From a continuous ODE to a finite-difference matrix

Replace $d^2\theta/dx^2$ at each interior node with the standard central difference $(\theta_{i-1}-2\theta_i+\theta_{i+1})/\Delta x^2$, and the ODE becomes a row of a linear system: $\theta_{i-1}-(2+(m\Delta x)^2)\theta_i+\theta_{i+1}=0$. The base node's known value moves to the right-hand side. The tip is the part that needs care — there's no $\theta_{N+1}$ node past the end of the fin.

The ghost-node trick

  1. Imagine a fictitious node $\theta_{N+1}$ just past the tip.
  2. Write the tip's boundary condition as a central difference: insulated means $d\theta/dx=0$, i.e. $\theta_{N+1}=\theta_{N-1}$; convective means $-k\,d\theta/dx=h\theta$, i.e. $\theta_{N+1}=\theta_{N-1}-2\Delta x\frac{h}{k}\theta_N$.
  3. Substitute that expression for $\theta_{N+1}$ into the interior stencil written at the tip node — the fictitious node cancels out, leaving a modified last row with a coefficient of 2 on the neighbor term instead of 1.

Setting $h=0$ in that last-row formula collapses it exactly to the insulated case — the same matrix, the convective term just switched off. That's the cleanest evidence the two cases were derived consistently rather than patched together separately.

▶ In the lab

Toggle between insulated and convective tip and watch the last matrix row's effective coefficient change live — the rest of the matrix never moves. Open the lab →

4Why the mesh converges, and how fast

Central differences are second-order accurate: halving $\Delta x$ should roughly quarter the error. At the lecture notes' original resolution ($N=6$), the tip temperature is off from the analytic answer by about 1.4% — visible, but already small. Push the resolution up and the finite-difference answer collapses onto the analytic curve, which is exactly the validation step every finite-difference solver should pass before being trusted on a problem with no analytic answer to check against — like the Gauss-Seidel or irregular-domain problems on this site, where there's no exact solution to compare to at all.

Key takeaways

EngineeringCandy · Learn · the design thinking behind the playground