Flow Lab

Syllabus / Module 9: Classical PDEs: Heat, Waves & Potentials

Lesson 9.3

Solving the Heat Equation: Separation of Variables

Separation of variables, eigenfunction expansions, Dirichlet & Neumann problems, nonhomogeneous boundary conditions.

Written byClaude Sonnet

🌊
Why this matters for simulation: High-frequency modes decay fastest — why diffusion smooths out small swirls first.

By the end of this lesson you can…

  • Separate $u = X(x)T(t)$ in $u_t = \alpha u_{xx}$, explain why both sides must equal a constant, and write the two ODEs that result.
  • Combine the separated solutions into the sine series for ends held at zero and the cosine series for insulated ends, and say which eigenvalue list each boundary condition produces.
  • Match an initial profile with Fourier coefficients and evaluate $u(x,t)$ at any time without time stepping.
  • Handle ends held at nonzero temperatures by subtracting the steady straight line, and solve the transient that remains.
  • Read the decay rates $\alpha(k\pi/L)^2$: predict how many modes a given time needs, how long a rod takes to settle, and why fine detail vanishes first.
On this page
·
  1. Try a product
  2. Ends held at zero: the sine series
  3. Worked example 1: a rod dropped into ice water
  4. Insulated ends: the cosine series
  5. One end hot, one end cold: the steady shift
  6. Decay rates: why fine detail vanishes first
  7. Is the series really the solution?
  8. The lab
  9. Computing it
  10. Concept checks
  11. Problems
  12. Key Takeaways

9.2 The Heat (Diffusion) Equation ended with a promise. A ripple e−λtsin⁡(kπx/L)e^{-\lambda t}\sin(k\pi x/L) solves the heat equation exactly, with its own decay rate, and any initial profile is made of ripples. 8.4 Even & Odd Extensions: Sine and Cosine Series then showed how to write a profile given on [0,L][0, L] as a sine or a cosine series. This lesson joins the two halves: separation of variables turns the PDE into two ODEs you already know how to solve, the boundary conditions pick the list of ripples, and Fourier coefficients pick the amounts. The result is a formula for u(x,t)u(x,t) at any time, with no time step and no stability limit.

The same recipe serves the viscous term of Navier-Stokes and, with other eigenfunctions, the wave and Laplace equations later in this module.

▶ Video A product of a shape and a decaying amplitude solves the heat equation; the boundary conditions pick the shapes; the initial profile picks the amounts; each mode fades at its own ratecaptions only
Transcript
  1. Start from u t equals alpha u x x and guess something simple: a product of a shape in x and an amplitude in t. Substitute, and divide by alpha X T. The left side depends on t alone, the right side on x alone. Move x and the left cannot change. Move t and the right cannot change. So both are one constant, which we call minus lambda, and one PDE has become two ODEs.
  2. The time equation is exponential decay: T equals e to the minus alpha lambda t. The space equation, minus X double prime equals lambda X, is the eigenvalue problem from before. Only special values of lambda have a nonzero solution that obeys the walls. So the question changes from what are the solutions, to what are the eigenpairs. Once we know an eigenvalue lambda, its decay rate alpha lambda comes free.
  3. Hold both ends at zero. A product then needs X of 0 and X of L to vanish, and that gives sine of k pi x over L, with lambda equal to k pi over L, squared. Each product solves the equation and both walls, and so does any sum of them, by superposition. Sum them all, with one amount c k per mode. At time zero this is exactly the sine series of the initial profile, so each c k is a single integral.
  4. The recipe has four steps. Separate. Let the boundary conditions act on X alone, to pick the eigenvalues and shapes. Superpose all the products. Then project the initial profile onto the shapes. Everything before the last step is independent of the initial data, so you do the hard work once for a given rod.
  5. Example: a hot rod plunged into ice water. Length 1, alpha 1, start at 1, both ends at 0. The coefficients are 4 over k pi for odd k: 1.273240, then 0.424413. Now run time. The corners at the walls are gone almost at once, because the high modes die first. At t equal 0.05 the centre is 0.772312 from the full series. One mode alone says 0.777310, and three modes give 0.772310. Late on, one mode is the whole solution.
  6. Insulate the ends instead. The condition is now zero slope, and the shapes are cosines, starting with a constant mode that never decays. So the rod settles at the average of the initial profile. For a half hot rod, the left end falls from 0.886156 at t equal 0.05 to 0.737244 at 0.1, while the right end rises to 0.113844 and then 0.262756. Hold one end and insulate the other, and the slowest rate drops to pi squared over 4: the rod keeps its heat 4 times longer.
  7. Now hold one end at zero and the other at one. A sum of solutions would double the end values, so superposition fails here. Peel off the part that never changes: the steady straight line w. Write u as w plus a transient v. The transient solves the same equation with zero ends and starting profile f minus w, which is the problem we already solved. For a cold rod, c k is 2 times minus 1 to the k, over k pi, so c 1 is minus 0.636620. At the centre the temperature climbs 0.113844, 0.262756, then 0.467040, toward 0.5.
  8. The whole solution is a list of amplitudes, and the rates grow as k squared. Mode 3 fades 9 times faster than mode 1, mode 10 a hundred times faster. For a tolerance of one millionth, the ice-water rod needs 31 modes at t equal 0.001, 9 at 0.01, and 3 at 0.1. Fine detail goes first, so even a jump at the walls smooths out the instant time starts. Run time backwards and the factor grows, which no coefficient list survives. To settle within 10 to the minus 3 takes ln of 1273.2 over pi squared, which is 0.7244.
  9. Small swirls die first. For air, nu is 1.47 times 10 to the minus 5. A ripple 1 centimetre long decays at 5.80 per second, an e-folding time of 0.172 seconds. A ripple 10 centimetres long decays a hundred times slower, 17.2 seconds. As numerics, the series gives u at any time in one evaluation, with no time loop and no stability limit. Explicit FTCS needs 625 steps to reach t equal 0.1, and at the centre of the tent rod it gives 0.302080 against the exact 0.302118.
  10. To recap. Separate, let the walls pick the eigenvalues, superpose, and project the initial profile. Held ends give sines. Insulated ends give cosines, with a mode that never decays. Unequal end temperatures give a straight line plus a transient. And every mode fades at its own rate, the fine ones first. Next, Burgers' equation adds a term u times u x to a diffusion equation. Solutions no longer add, and this whole recipe breaks.

Try a product

Take ut=αuxxu_t = \alpha u_{xx} on 0<x<L0 \lt x \lt L and look for solutions that are a product of a function of xx alone and a function of tt alone, u=X(x) T(t)u = X(x)\,T(t). This is a guess: most solutions are not products, but products turn out to be enough building blocks. Substituting,

X(x) T′(t)=α X′′(x) T(t)⟹T′(t)α T(t)=X′′(x)X(x).X(x)\,T'(t) = \alpha\,X''(x)\,T(t) \quad\Longrightarrow\quad \frac{T'(t)}{\alpha\,T(t)} = \frac{X''(x)}{X(x)}.

The left side depends on tt only and the right side on xx only. Fix tt and move xx: the left side does not change, so the right side cannot either. Fix xx and move tt: the same argument runs the other way. A quantity that cannot change with either variable is a constant; call it −λ-\lambda (the sign is a convenience, and it anticipates the answer). The one PDE has become two ODEs:

T′=−αλ T,−X′′=λX.T' = -\alpha\lambda\,T, \qquad\qquad -X'' = \lambda X.

The time equation is exponential decay, T=e−αλtT = e^{-\alpha\lambda t}. The space equation is the eigenvalue problem of 8.2 Eigenvalue Problems & Sturm–Liouville Theory: only for special λ\lambda does it have a nonzero solution that obeys the boundary conditions, and those λ\lambda are the eigenvalues. Separation has turned the question “what are the solutions?” into “what are the eigenpairs?”, and the PDE’s time dependence is then free: eigenvalue λ\lambda means decay rate αλ\alpha\lambda.

Ends held at zero: the sine series

Hold both ends at zero temperature, u(0,t)=u(L,t)=0u(0,t) = u(L,t) = 0 for all tt. A product has X(0)T(t)=0X(0)T(t) = 0 for all tt, which forces X(0)=0X(0) = 0 (otherwise T≡0T \equiv 0 and we have only the zero solution), and likewise X(L)=0X(L) = 0. The Dirichlet problem of the eigenvalue lesson gives

λk=(kπL)2,Xk(x)=sin⁡kπxL,k=1,2,3,…\lambda_k = \Bigl(\frac{k\pi}{L}\Bigr)^2, \quad X_k(x) = \sin\frac{k\pi x}{L}, \quad k = 1, 2, 3, \dots

(The cases λ≤0\lambda \le 0 give only X=0X = 0; that was shown there.) Each product e−α(kπ/L)2tsin⁡(kπx/L)e^{-\alpha(k\pi/L)^2 t}\sin(k\pi x/L) solves the PDE and both boundary conditions. The PDE and the boundary conditions are linear and homogeneous, so any sum of such products does too (superposition, the property that 9.1 What Is a PDE? Conservation Laws & Classification listed in its table of linear equations). Take all of them:

u(x,t)=∑k=1∞ck e−α(kπ/L)2t sin⁡kπxL.u(x,t) = \sum_{k=1}^{\infty} c_k\,e^{-\alpha(k\pi/L)^2 t}\,\sin\frac{k\pi x}{L}.

The last condition is the initial profile, u(x,0)=f(x)=∑cksin⁡(kπx/L)u(x,0) = f(x) = \sum c_k \sin(k\pi x/L). That is exactly the sine series of ff, and 8.4 Even & Odd Extensions: Sine and Cosine Series gave its coefficients: ck=2L∫0Lf(x)sin⁡(kπx/L) dxc_k = \frac{2}{L}\int_0^L f(x)\sin(k\pi x/L)\,dx. So one integral per mode finishes the problem. The recipe in full:

Worked example 1: a rod dropped into ice water

Take L=1L = 1 and α=1\alpha = 1, so time is in units of L2/αL^2/\alpha. The rod starts at u=1u = 1 everywhere and both ends are held at 00, which is what happens when you plunge a hot rod into ice water. The sine coefficients of f=1f = 1 are

ck=2∫01sin⁡kπx dx=2(1−cos⁡kπ)kπ={4/(kπ)k odd,0k even.c_k = 2\int_0^1 \sin k\pi x\,dx = \frac{2(1 - \cos k\pi)}{k\pi} = \begin{cases} 4/(k\pi) & k \text{ odd},\\ 0 & k \text{ even}.\end{cases}

So c1=4/π=1.273240c_1 = 4/\pi = 1.273240, c3=4/(3π)=0.424413c_3 = 4/(3\pi) = 0.424413, and

u(x,t)=4π(e−π2tsin⁡πx+13e−9π2tsin⁡3πx+15e−25π2tsin⁡5πx+⋯ ).u(x,t) = \frac{4}{\pi}\Bigl(e^{-\pi^2 t}\sin\pi x + \frac13 e^{-9\pi^2 t}\sin 3\pi x + \frac15 e^{-25\pi^2 t}\sin 5\pi x + \cdots\Bigr).

Look at the centre, x=12x = \tfrac12, where sin⁡(kπ/2)\sin(k\pi/2) alternates +1,−1,…+1, -1, \dots for k=1,3,…k = 1, 3, \dots. At t=0.05t = 0.05 the full series gives u=0.772312u = 0.772312. One mode gives 0.7773100.777310 and three give 0.7723100.772310: the first term has the right answer to 0.6%0.6\% and the second correction fixes it to six digits, because the factor e−9π2te^{-9\pi^2 t} has already shrunk to 0.01180.0118. At t=0.1t = 0.1 the full value is 0.4744870.474487 and the single first term gives 0.4745460.474546, which is 1.2×10−41.2\times10^{-4} off in relative terms. Late on one mode is the whole solution, matching the time constant L2/(π2α)=0.1013L^2/(\pi^2\alpha) = 0.1013 of 9.2.

At t=0t = 0 the profile jumps from 11 to 00 at the walls, and the sine series converges slowly there (like 1/k1/k). Yet the very next instant is smooth: at t=0.001t = 0.001 the centre value is 1.0000001.000000 and the high modes are gone.

How long until the rod is within 10−310^{-3} of the ice-water temperature? Late on only the first mode matters, so 1.2732 e−π2t=10−31.2732\,e^{-\pi^2 t} = 10^{-3} gives

t=ln⁡(1273.2)π2=0.7244.t = \frac{\ln(1273.2)}{\pi^2} = 0.7244.

The sim’s direct search over the full series returns 0.724380.72438.

Insulated ends: the cosine series

Now insulate both ends: ux(0,t)=ux(L,t)=0u_x(0,t) = u_x(L,t) = 0. The condition on a product is X′(0)=X′(L)=0X'(0) = X'(L) = 0. The Neumann problem of the eigenvalue lesson has eigenvalues λk=(kπ/L)2\lambda_k = (k\pi/L)^2 again, but now for k=0,1,2,…k = 0, 1, 2, \dots with shapes cos⁡(kπx/L)\cos(k\pi x/L): the list starts at λ0=0\lambda_0 = 0 with the constant shape, which decays at rate zero.

u(x,t)=a02+∑k=1∞ak e−α(kπ/L)2tcos⁡kπxL,ak=2L∫0Lf(x)cos⁡kπxL dx.u(x,t) = \frac{a_0}{2} + \sum_{k=1}^{\infty} a_k\,e^{-\alpha(k\pi/L)^2 t}\cos\frac{k\pi x}{L}, \qquad a_k = \frac{2}{L}\int_0^L f(x)\cos\frac{k\pi x}{L}\,dx.

The constant mode never decays, so as t→∞t \to \infty the rod settles at a0/2a_0/2, the average of the initial profile: insulated means the heat has nowhere to go. This is the conservation law of 9.2 seen mode by mode: every cosine with k≥1k \ge 1 integrates to zero.

Example 2. With L=α=1L = \alpha = 1, start with the left half hot, f=1f = 1 for x<12x \lt \tfrac12 and 00 for x>12x \gt \tfrac12. The mean is a0/2=12a_0/2 = \tfrac12 and ak=2∫01/2cos⁡kπx dx=2sin⁡(kπ/2)/(kπ)a_k = 2\int_0^{1/2}\cos k\pi x\,dx = 2\sin(k\pi/2)/(k\pi). That gives a1=2/π=0.636620a_1 = 2/\pi = 0.636620, a2=0a_2 = 0, a3=−0.212207a_3 = -0.212207. The sim reports the left end u(0,t)u(0,t) falling from 0.8861560.886156 at t=0.05t = 0.05 to 0.7372440.737244 at t=0.1t = 0.1, while the right end rises to 0.1138440.113844 and then 0.2627560.262756. The two ends add to 11 by symmetry. After t=0.65415t = 0.65415 the whole rod is within 10−310^{-3} of 12\tfrac12, in agreement with the FTCS run of 9.2 (step 40874087, t=0.654t = 0.654).

A mixed rod, held at zero at x=0x = 0 and insulated at x=Lx = L, has X(0)=0X(0) = 0 and X′(L)=0X'(L) = 0. The shapes are sin⁡((k−12)πx/L)\sin\bigl((k - \tfrac12)\pi x/L\bigr) and the decay rates α((k−12)π/L)2\alpha\bigl((k - \tfrac12)\pi/L\bigr)^2. The slowest one is π2/4\pi^2/4 in our units, a quarter of the both-ends-held rate π2\pi^2: leaving one end insulated lets the rod keep its heat four times longer (time constant 4/π2=0.40534/\pi^2 = 0.4053 against 0.10130.1013).

One end hot, one end cold: the steady shift

Suppose u(0,t)=TLu(0,t) = T_L and u(L,t)=TRu(L,t) = T_R. Now a sum of products is not allowed: the boundary condition is not homogeneous, so a sum of two solutions has end value 2TL2T_L, not TLT_L. The fix is to peel off the part that does not change. From 9.2 the steady state is the straight line w(x)=TL+(TR−TL)x/Lw(x) = T_L + (T_R - T_L)x/L, which solves wxx=0w_{xx} = 0 and has the right end values. Write u=w(x)+v(x,t)u = w(x) + v(x,t). Since wt=0w_t = 0 and wxx=0w_{xx} = 0, the transient vv solves the same heat equation, with v(0,t)=v(L,t)=0v(0,t) = v(L,t) = 0 and initial profile f(x)−w(x)f(x) - w(x). That is the zero-ends problem already solved: expand f−wf - w in sines and let each mode decay.

Example 3. Cold rod, f=0f = 0, with ends at TL=0T_L = 0 and TR=1T_R = 1, and L=α=1L = \alpha = 1. The initial transient is −x-x. Using ∫01xsin⁡kπx dx=(−1)k+1/(kπ)\int_0^1 x\sin k\pi x\,dx = (-1)^{k+1}/(k\pi),

ck=2∫01(−x)sin⁡kπx dx=2(−1)kkπ,u(x,t)=x+∑k=1∞2(−1)kkπ e−k2π2tsin⁡kπx.c_k = 2\int_0^1 (-x)\sin k\pi x\,dx = \frac{2(-1)^k}{k\pi}, \qquad u(x,t) = x + \sum_{k=1}^{\infty}\frac{2(-1)^k}{k\pi}\,e^{-k^2\pi^2 t}\sin k\pi x.

The sim gives c1=−0.636620c_1 = -0.636620 and c2=0.318310c_2 = 0.318310. At the centre the temperature climbs 0.1138440.113844 at t=0.05t = 0.05, 0.2627560.262756 at t=0.1t = 0.1 and 0.4670400.467040 at t=0.3t = 0.3, toward the steady 0.50.5. A quarter of the way along, u(0.25,0.1)=0.088344u(0.25, 0.1) = 0.088344. The profile is within 10−310^{-3} of the straight line everywhere after t=0.65415t = 0.65415, the same time as in Example 2 because both start with a leading amplitude 2/π2/\pi and rate π2\pi^2.

Decay rates: why fine detail vanishes first

The whole solution is the list of amplitudes cke−αλktc_k e^{-\alpha\lambda_k t}, and the rates grow as k2k^2. Mode kk decays k2k^2 times faster than mode 1 (the sim’s bars at the right show this on a log scale: the amplitudes fall on a downward parabola in kk). Its time constant is τk=L2/(αk2π2)\tau_k = L^2/(\alpha k^2\pi^2).

Two consequences for a solver. First, truncation: keep only modes whose amplitude is above your tolerance. For the ice-water rod at 10−610^{-6} the sim reports 3131 modes at t=0.001t = 0.001, 99 at t=0.01t = 0.01 and 33 at t=0.1t = 0.1 (the count falls roughly like 1/t1/\sqrt t, a scaling and not an exact law).

Second, smoothing. At t=0t = 0 the series for the jumpy profile converges only like 1/k1/k. For any t>0t \gt 0 the factor e−α(kπ/L)2te^{-\alpha(k\pi/L)^2 t} decays faster than any power of kk, so even the series for uxxu_{xx} or uxxxu_{xxx} converges; the solution is smooth for every t>0t \gt 0, even when ff jumps (stated here from the convergence of those series, not proved in full). Run time backwards and the factor becomes e+αλkte^{+\alpha\lambda_k t}, which no coefficient list can survive: the ill-posedness of 9.1 in one line.

Is the series really the solution?

Three honest questions, answered briefly.

Does it solve the PDE? Each term does, and for t>0t \gt 0 termwise differentiation is legitimate because kme−k2π2tk^m e^{-k^2\pi^2 t} is summable for every mm (sketched, not proved).

Does it match ff at t=0t = 0? In the rms sense of 8.3 Fourier Series, always; pointwise away from jumps, yes. The Gibbs ringing belongs to 8.5 Convergence & the Gibbs Phenomenon.

Is it the only solution? Suppose ww is the difference of two solutions with the same data. Then ww solves the heat equation with zero initial data and either w=0w = 0 or wx=0w_x = 0 at each end. Compute the “energy” E(t)=∫0Lw2 dxE(t) = \int_0^L w^2\,dx:

E′(t)=2∫0Lw wt dx=2α∫0Lw wxx dx=2α[w wx]0L−2α∫0Lwx2 dx≤0.E'(t) = 2\int_0^L w\,w_t\,dx = 2\alpha\int_0^L w\,w_{xx}\,dx = 2\alpha\bigl[w\,w_x\bigr]_0^L - 2\alpha\int_0^L w_x^2\,dx \le 0 .

The boundary term vanishes for either kind of end, and E(0)=0E(0) = 0, so E≡0E \equiv 0 and w≡0w \equiv 0. The solution we built is the solution.

The lab

◆ Interactive Choose the ends and the initial profile; slide t and the number of modes N; compare with explicit FTCS

Loading simulation…

The rod has L=α=1L = \alpha = 1. Panel 1 shows u(x,t)u(x,t) from NN modes, the initial ff dashed, a 200200-mode reference dotted and (if ticked) FTCS on 5050 intervals with r=0.4r = 0.4. Panel 2 shows log⁡10∣ck∣\log_{10}|c_k| in grey and log⁡10\log_{10} of the current amplitude ∣ck∣e−(kπ)2t|c_k|e^{-(k\pi)^2 t} in colour (red for dropped modes). Panel 3 shows the rms error of the NN-mode sum against tt. Coefficients come from the midpoint rule on 80008000 cells, with closed forms beside them as a check.

  1. Ice-water rod (Dirichlet, f=1f = 1). Move tt from 00 to 0.050.05 and watch the bars on the right fall: mode 33 is multiplied by e−9π2t=0.0118e^{-9\pi^2 t} = 0.0118 at t=0.05t = 0.05. The panel-3 rms error against the reference at t=0.05t = 0.05 is 7.9×10−77.9\times10^{-7} for N=3N = 3 and 3.5×10−33.5\times10^{-3} for N=1N = 1.
  2. Insulated ends with the half step. The profile levels off at 0.50.5 and the “integral of uu” readout stays at 0.50.5.
  3. Shift, f=0f = 0, TL=0T_L = 0, TR=1T_R = 1. The solution climbs to the line u=xu = x.
  4. Tick FTCS. For the tent profile (f=2xf = 2x then 2(1−x)2(1 - x), peak 11) at t=0.1t = 0.1, which is 625625 steps of 1.6×10−41.6\times10^{-4}, the largest difference at the nodes is 3.8×10−53.8\times10^{-5}; for f=1f = 1 it is 3.70×10−43.70\times10^{-4}, ten times worse, because the jump at the walls is what the grid resolves least well.

Computing it

🐍 PythonLab: the tent rod with ends at zero; series with 1, 3 and 60 modes, against explicit FTCS
⌘/Ctrl + Enter

The first loop should print 0.7743240.774324, 0.4959120.495912 and 0.3021180.302118 in the last column; the second reports 2525, 99 and 33 modes (fewer than for f=1f = 1 at early times, since the tent is smoother), and FTCS gives 0.3020800.302080.

🧪 Coding exerciseExercise: the heat solution for any held-end temperatures, and the settling time
⌘/Ctrl + Enter

Concept checks

✅ Concept check

In $T'/(\alpha T) = X''/X$ the two sides must both equal a constant because

✅ Concept check

A rod of length $L = 2$ with $\alpha = 1$ has both ends held at $0$. What is the decay rate of its slowest mode, $\alpha(\pi/L)^2$? (Give a number.)

✅ Concept check

Mode $6$ of a rod decays how many times faster than mode $2$ (same rod, same boundary conditions)?

✅ Concept checkselect all that apply

Which statements about the long-time behaviour are correct?

Problems

✏️ Pen & paperHow long to cool a copper bar?●○○

A copper bar of length L=0.5L = 0.5 m, with α=1.16×10−4\alpha = 1.16\times10^{-4} m2^2/s (a rounded value, from memory), has both ends held at 0∘0^\circC and starts at u=100sin⁡(πx/L)u = 100\sin(\pi x/L). How long until the peak temperature falls to 1∘1^\circC?

Show worked solution

The initial profile is a single mode, so u=100 e−απ2t/L2sin⁡(πx/L)u = 100\,e^{-\alpha\pi^2 t/L^2}\sin(\pi x/L) and the peak is at the centre. Set 100 e−απ2t/L2=1100\,e^{-\alpha\pi^2 t/L^2} = 1, giving t=ln⁡(100) L2/(απ2)=4.60517×0.25/(1.16×10−4×9.8696)=1005.6t = \ln(100)\,L^2/(\alpha\pi^2) = 4.60517\times0.25/(1.16\times10^{-4}\times9.8696) = 1005.6 s, about 16.816.8 minutes. The time constant is L2/(απ2)=218.4L^2/(\alpha\pi^2) = 218.4 s, and ln⁡100=4.605\ln 100 = 4.605 of them are needed.

✏️ Pen & paperTwo modes and a crossover●●○

With L=α=1L = \alpha = 1, ends at 00, start from u(x,0)=sin⁡πx+3sin⁡3πxu(x,0) = \sin\pi x + 3\sin 3\pi x. (a) Find u(12,t)u(\tfrac12, t) and evaluate it at t=0.05t = 0.05. (b) At what time is the second mode one percent of the first, as measured by its amplitude?

Show worked solution

(a) The initial profile is already a sum of two eigenfunctions, so u=e−π2tsin⁡πx+3 e−9π2tsin⁡3πxu = e^{-\pi^2 t}\sin\pi x + 3\,e^{-9\pi^2 t}\sin3\pi x. At x=12x = \tfrac12, sin⁡(π/2)=1\sin(\pi/2) = 1 and sin⁡(3π/2)=−1\sin(3\pi/2) = -1, so u(12,t)=e−π2t−3 e−9π2tu(\tfrac12, t) = e^{-\pi^2 t} - 3\,e^{-9\pi^2 t}. At t=0.05t = 0.05: e−0.49348=0.610498e^{-0.49348} = 0.610498 and e−4.44132=0.011780e^{-4.44132} = 0.011780, so u=0.610498−0.035341=0.57516u = 0.610498 - 0.035341 = 0.57516.

(b) The amplitude ratio is 3 e−9π2t/e−π2t=3 e−8π2t3\,e^{-9\pi^2 t}/e^{-\pi^2 t} = 3\,e^{-8\pi^2 t}. Setting this to 0.010.01 gives t=ln⁡(300)/(8π2)=5.7038/78.957=0.07224t = \ln(300)/(8\pi^2) = 5.7038/78.957 = 0.07224.

✏️ Pen & paperOne end insulated●●●

A rod with L=α=1L = \alpha = 1 is held at 00 at x=0x = 0 and insulated at x=1x = 1, and starts at u=1u = 1. (a) Separate variables and show the shapes are sin⁡((k−12)πx)\sin\bigl((k - \tfrac12)\pi x\bigr) with rates (k−12)2π2(k - \tfrac12)^2\pi^2. (b) Find the coefficients. (c) Estimate when the insulated end u(1,t)u(1,t) falls to 0.50.5.

Show worked solution

(a) A product needs X′′=−λXX'' = -\lambda X with X(0)=0X(0) = 0 and X′(1)=0X'(1) = 0. For λ=ω2>0\lambda = \omega^2 \gt 0 we have X=sin⁡ωxX = \sin\omega x (it vanishes at 00) and X′(1)=ωcos⁡ω=0X'(1) = \omega\cos\omega = 0 requires ω=(k−12)π\omega = (k - \tfrac12)\pi, k=1,2,…k = 1, 2, \dots. (The cases λ≤0\lambda \le 0 give only X=0X = 0.)

(b) With m=(k−12)πm = (k - \tfrac12)\pi, ck=2∫01sin⁡(mx) dx=2(1−cos⁡m)/m=2/mc_k = 2\int_0^1\sin(mx)\,dx = 2(1 - \cos m)/m = 2/m, since cos⁡m=0\cos m = 0. So c1=4/π=1.273240c_1 = 4/\pi = 1.273240 and c2=4/(3π)=0.424413c_2 = 4/(3\pi) = 0.424413, and ck=4/((2k−1)π)c_k = 4/((2k - 1)\pi).

(c) At x=1x = 1, sin⁡m=(−1)k+1\sin m = (-1)^{k+1}, so u(1,t)=c1e−π2t/4−c2e−9π2t/4+⋯u(1,t) = c_1 e^{-\pi^2 t/4} - c_2 e^{-9\pi^2 t/4} + \cdots. With only the first term, 1.27324 e−2.4674 t=0.51.27324\,e^{-2.4674\,t} = 0.5 gives t=ln⁡(2.54648)/2.4674=0.3788t = \ln(2.54648)/2.4674 = 0.3788. The second term then is only 9×10−59\times10^{-5}.

Key Takeaways

  • Substituting u=X(x)T(t)u = X(x)T(t) into ut=αuxxu_t = \alpha u_{xx} gives T′/(αT)=X′′/XT'/(\alpha T) = X''/X; both sides are constant, which splits the PDE into T′=−αλTT' = -\alpha\lambda T and −X′′=λX-X'' = \lambda X.
  • The boundary conditions act on XX and pick the eigenvalues: ends at 00 give sin⁡(kπx/L)\sin(k\pi x/L), insulated ends give cos⁡(kπx/L)\cos(k\pi x/L) including a constant mode of rate 00, and one held plus one insulated end gives sin⁡((k−12)πx/L)\sin((k - \tfrac12)\pi x/L).
  • u=∑cke−αλktXk(x)u = \sum c_k e^{-\alpha\lambda_k t}X_k(x), with ckc_k the Fourier projection of ff. For f=1f = 1 and ends at 00: ck=4/(kπ)c_k = 4/(k\pi) for odd kk, and u(12,0.05)=0.772312u(\tfrac12, 0.05) = 0.772312.
  • Insulated rods approach the mean of ff (the half step settles to 0.50.5, within 10−310^{-3} after t=0.65415t = 0.65415); a held-end rod approaches the straight line between TLT_L and TRT_R, found by the shift u=w+vu = w + v and a zero-ends problem for vv.
  • Mode kk decays at rate α(kπ/L)2\alpha(k\pi/L)^2: fine detail dies first, jumps smooth out instantly, and late in time one mode is the whole solution (a time constant L2/(π2α)L^2/(\pi^2\alpha) for held ends, four times longer for one insulated end).
  • The series needs 3131, 99 and 33 modes at t=0.001t = 0.001, 0.010.01, 0.10.1 for the ice-water rod at tolerance 10−610^{-6}; FTCS takes 625625 steps to reach t=0.1t = 0.1 and agrees to 3.8×10−53.8\times10^{-5} for the tent profile.
  • Everything rested on superposition. Time-dependent ends or sources need 9.7 Nonhomogeneous Problems & Eigenfunction Expansions.
  • Next in the build order is 9.11 Nonlinear Waves: Burgers' Equation & Shocks (Burgers’ equation), which adds u uxu\,u_x to a diffusion equation. That term breaks superposition: solutions no longer add, energy passes from mode kk toward mode 2k2k, and the characteristics of 9.10 First-Order PDEs: Advection & Characteristics cross. The Cole-Hopf substitution u=−2ν φx/φu = -2\nu\,\varphi_x/\varphi turns viscous Burgers back into this lesson’s heat equation (checked: with φ=1+e−ax+νa2t\varphi = 1 + e^{-ax + \nu a^2 t}, finite differences give a Burgers residual of 1.3×10−101.3\times10^{-10} against a utu_t of 0.01040.0104; the derivation is not given here).
Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.