Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Big Idea

A linear BVP Lu=f\mathcal{L} u = f on [1,1][-1, 1] becomes a finite linear system once we choose a discretisation. The ultraspherical method of Olver & Townsend (2013) writes the unknown uu in the Chebyshev TkT_k basis and each derivative in its own ultraspherical basis Ck(λ)C_k^{(\lambda)}, producing a sparse, well-conditioned, almost-banded operator. The textbook alternative is physical-space collocation, which writes everything in the value basis at Chebyshev nodes; it is conceptually simple, but its operator is dense and its conditioning scales like N2kN^{2k} in the differentiation order kk. We develop the ultraspherical method first, then look at physical-space collocation for comparison.

The Ultraspherical Method

The unknown uu is expanded in Chebyshev polynomials, u(x)=k=0NckTk(x)u(x) = \sum_{k=0}^{N} c_k\, T_k(x), and the unknowns become the coefficients c=(c0,,cN)\mathbf{c} = (c_0, \ldots, c_N). The trick is to use different bases for different orders of derivative: uu in Tk=Ck(0)T_k = C_k^{(0)}, uu' in Uk=Ck(1)U_k = C_k^{(1)}, uu'' in Ck(2)C_k^{(2)}, and so on. Each level is connected to the next by sparse, well-conditioned operators. The price is some bookkeeping; the reward is a banded linear system.

We illustrate by working through the simplest non-trivial BVP, then extend to variable coefficients.

Worked example: u(x)=f(x), u(1)=αu'(x) = f(x),\ u(-1) = \alpha

Step 1: Differentiation operator. From Tk(x)=kUk1(x)T_k'(x) = k\, U_{k-1}(x) for k1k \ge 1,

u(x)=k=1NkckUk1(x).u'(x) = \sum_{k=1}^{N} k\, c_k\, U_{k-1}(x).

So the UU-basis coefficients of uu' are obtained from c\mathbf{c} by

D0=(0100000200000300000N)RN×(N+1),\mathcal{D}_0 = \begin{pmatrix} 0 & 1 & 0 & 0 & \cdots & 0 \\ 0 & 0 & 2 & 0 & \cdots & 0 \\ 0 & 0 & 0 & 3 & \cdots & 0 \\ \vdots & & & & \ddots & \vdots \\ 0 & 0 & 0 & 0 & \cdots & N \end{pmatrix} \in \mathbb{R}^{N \times (N+1)},

a single super-diagonal of strictly increasing entries. Applying it costs O(N)O(N).

Step 2: Conversion operator. The right-hand side ff is given as a Chebyshev expansion f=fkTkf = \sum f_k\, T_k, but the equation u=fu' = f asks us to compare two coefficient vectors in different bases. The bridge is

T0=U0,T1=12U1,Tk=12(UkUk2) for k2,T_0 = U_0, \qquad T_1 = \tfrac{1}{2} U_1, \qquad T_k = \tfrac{1}{2}\big(U_k - U_{k-2}\big) \text{ for } k \ge 2,

so the conversion matrix from TT- to UU-coefficients is

S0=(10120001201200012012)RN×(N+1),\mathcal{S}_0 = \begin{pmatrix} 1 & 0 & -\tfrac{1}{2} & 0 & 0 & \cdots \\ 0 & \tfrac{1}{2} & 0 & -\tfrac{1}{2} & 0 & \cdots \\ 0 & 0 & \tfrac{1}{2} & 0 & -\tfrac{1}{2} & \cdots \\ \vdots & & & & \ddots & \end{pmatrix} \in \mathbb{R}^{N \times (N+1)},

with a main diagonal at 12\tfrac{1}{2} (the 0,00,0 entry is 1) and a second super-diagonal at 12-\tfrac{1}{2}. Bandwidth two; O(N)O(N) to apply.

Step 3: Boundary condition. Since Tk(1)=(1)kT_k(-1) = (-1)^k, the condition u(1)=αu(-1) = \alpha is one linear constraint on c\mathbf{c}:

bc=α,b=(1,1,1,1,,(1)N).\mathbf{b}^\top \mathbf{c} = \alpha, \qquad \mathbf{b} = (1, -1, 1, -1, \ldots, (-1)^N).

A single dense row.

Step 4: Assemble. Stacking the boundary row above D0\mathcal{D}_0 produces a square (N+1)×(N+1)(N+1) \times (N+1) system,

(bD0)Lc=(αS0fT),\underbrace{\begin{pmatrix} \mathbf{b}^\top \\ \mathcal{D}_0 \end{pmatrix}}_{\mathcal{L}} \, \mathbf{c} = \begin{pmatrix} \alpha \\ \mathcal{S}_0 \mathbf{f}_T \end{pmatrix},

where fT\mathbf{f}_T holds the Chebyshev coefficients of ff. The operator L\mathcal{L} is almost banded: one dense row sitting on top of a sparse banded block. An O(N)O(N) banded factorisation handles the bulk, with a small dense correction for the boundary row.

Source
<Figure size 450x450 with 1 Axes>

Multiplication operator for variable coefficients

For an equation with a variable coefficient like a(x)u(x)+u(x)=f(x)a(x)\, u'(x) + u(x) = f(x), we need one more piece: a multiplication operator M1[a]M_1[a] that takes the UU-coefficients of uu' and returns the UU-coefficients of aua\, u'. We build it in three steps using the Chebyshev recurrence.

See Also

The pointwise product of two Chebyshev expansions makes the coefficient space into a Banach algebra. The multiplication operator M1[a]M_1[a] below is the matrix realisation of “multiply by aa” in this algebra. For the analytic underpinnings see Banach Algebras (MATH 725).

Building block. Multiplication by xx in the UU basis. The identity xUk=12(Uk+1+Uk1)x\, U_k = \tfrac{1}{2}(U_{k+1} + U_{k-1}) (with U1=0U_{-1} = 0) gives the symmetric tridiagonal

M1[x]=12(01101101).M_1[x] = \tfrac{1}{2}\begin{pmatrix} 0 & 1 & & \\ 1 & 0 & 1 & \\ & 1 & 0 & 1 \\ & & \ddots & \ddots & \ddots \end{pmatrix}.

Multiplication by TkT_k. The Chebyshev recurrence Tk+1=2xTkTk1T_{k+1} = 2 x T_k - T_{k-1} lifts directly to operators:

M1[T0]=I,M1[T1]=M1[x],M1[Tk+1]=2M1[x]M1[Tk]M1[Tk1].M_1[T_0] = I, \qquad M_1[T_1] = M_1[x], \qquad M_1[T_{k+1}] = 2\, M_1[x]\, M_1[T_k] - M_1[T_{k-1}].

Each application of M1[x]M_1[x] widens the band by one, so M1[Tk]M_1[T_k] has bandwidth exactly kk.

General aa. If a(x)=k=0dakTk(x)a(x) = \sum_{k=0}^{d} a_k\, T_k(x), linearity gives

M1[a]=k=0dakM1[Tk],M_1[a] = \sum_{k=0}^{d} a_k\, M_1[T_k],

a banded matrix of bandwidth at most dd. A coefficient aa with a short Chebyshev expansion produces a narrow operator. The simplest case a(x)=1+xa(x) = 1 + x has aT=(1,1,0,)a_T = (1, 1, 0, \ldots) and gives the tridiagonal M1[1+x]=I+M1[x]M_1[1+x] = I + M_1[x].

The full operator. For a(x)u(x)+u(x)=f(x)a(x)\, u'(x) + u(x) = f(x),

L=(bM1[a]D0+S0),\mathcal{L} = \begin{pmatrix} \mathbf{b}^\top \\ M_1[a]\, \mathcal{D}_0 + \mathcal{S}_0 \end{pmatrix},

an almost-banded operator: dense top row from the boundary condition, banded interior of bandwidth max(d,2)\max(d, 2). The construction extends to any number of dense rows (more boundary conditions) and any short-Chebyshev coefficients.

This is the operator we use in Adaptive QR: Choosing N on the Fly to drive the QR sweep on a genuinely variable-coefficient problem.

Preconditioning for direct solves

The ultraspherical operator L\mathcal{L} is sparse, but it is not yet well-scaled. The differentiation matrix D0\mathcal{D}_0 has rows growing linearly with the column index — entry D0[k1,k]=k\mathcal{D}_0[k-1, k] = k, so the kk-th column of the interior is kk times bigger than the first. A direct solve via linalg.solve works, but its forward error inherits a condition number that scales with NN.

The fix is a diagonal right preconditioner (Olver & Townsend (2013), §4.1). For an order-ν\nu operator, set

R=diag(R0,R1,,RN),Rk={1,0kν2,1/(ν1)!,k=ν1,1/k,kν.R = \mathrm{diag}(R_0, R_1, \ldots, R_N), \qquad R_k = \begin{cases} 1, & 0 \le k \le \nu - 2, \\[2pt] 1/(\nu - 1)!, & k = \nu - 1, \\[2pt] 1/k, & k \ge \nu. \end{cases}

For the first-order problems of this section (ν=1\nu = 1): R=diag(1,1,12,13,,1N)R = \mathrm{diag}(1,\, 1,\, \tfrac{1}{2},\, \tfrac{1}{3},\, \ldots,\, \tfrac{1}{N}).

The recipe for a direct solve is two lines of bookkeeping.

  1. Build L~:=LR\tilde{\mathcal{L}} := \mathcal{L}\, R by scaling the columns of L\mathcal{L}.

  2. Solve L~y=g\tilde{\mathcal{L}}\, \mathbf{y} = \mathbf{g} as usual, then recover c=Ry\mathbf{c} = R\, \mathbf{y}.

Olver-Townsend prove κ2(L~)53.6\kappa_2(\tilde{\mathcal{L}}) \le 53.6 for the Dirichlet problem independent of NN, so the preconditioned solve has the same O(N)O(N) cost but a bounded condition number. The same trick works for the streaming QR of Adaptive QR: Choosing N on the Fly: scale columns on the way in and rescale the recovered solution on the way out; the factorisation itself is unchanged.

Source
    N      kappa(L)    kappa(L R)
   16      2.82e+01      3.28e+00
   32      5.65e+01      3.31e+00
   64      1.13e+02      3.33e+00
  128      2.27e+02      3.34e+00
  256      4.53e+02      3.34e+00
  512      9.07e+02      3.34e+00

Without scaling, κ(L)\kappa(\mathcal{L}) grows with NN. With scaling, the condition number is bounded by a small constant. That is what makes the ultraspherical method well-conditioned in the practical sense, not just sparse.

Physical-Space Collocation: an Alternative

The textbook alternative writes everything in the value basis at Chebyshev nodes. Let

a(x)u(x)+b(x)u(x)+c(x)u(x)=f(x),u(1)=α, u(1)=β,a(x)\, u''(x) + b(x)\, u'(x) + c(x)\, u(x) = f(x), \qquad u(-1) = \alpha,\ u(1) = \beta,

be a linear two-point BVP, and let u=(u(x0),,u(xN))T\mathbf{u} = (u(x_0), \ldots, u(x_N))^T be the unknown values at the type-1 Chebyshev nodes. From §5, differentiation at the nodes is DNuD_N \mathbf{u} and DN2uD_N^2 \mathbf{u}, so the differential operator becomes the matrix

LN=diag(a)DN2+diag(b)DN+diag(c).L_N = \mathrm{diag}(a)\, D_N^2 + \mathrm{diag}(b)\, D_N + \mathrm{diag}(c).

Demanding LNu=fL_N \mathbf{u} = \mathbf{f} at the interior nodes and replacing the first and last rows with the boundary conditions gives a square linear system to solve.

That is all there is to it: one differentiation matrix, one diagonal multiplication for each coefficient, two row replacements for the boundary conditions.

Worked example

Solve u+(1+x2)u=f-u'' + (1 + x^2)\, u = f on [1,1][-1, 1] with homogeneous Dirichlet boundary conditions, manufacturing ff from uexact(x)=(1x2)esin5xu_{\mathrm{exact}}(x) = (1 - x^2)\, e^{\sin 5x}.

Source
<Figure size 1100x420 with 2 Axes>

The error halves the digit count between N=8N = 8 and N=32N = 32. This is geometric convergence, exactly the coefficient-decay result transported through the linear solve.

The conditioning problem

Geometric convergence is the prize. The cost is two-fold:

  1. Density. LNL_N is dense, so each solve costs O(N3)O(N^3) instead of O(N)O(N) for a banded system.

  2. Conditioning. From §5, κ(DN2)N4\kappa(D_N^2) \sim N^4. Backward stability of solve then bounds the achievable accuracy at κ(LN)εmachN41016\kappa(L_N) \cdot \varepsilon_{\mathrm{mach}} \sim N^4 \cdot 10^{-16}. For high-order operators (think u(4)u^{(4)} in beam equations) the exponent grows: κ(DNk)N2k\kappa(D_N^k) \sim N^{2k}. Pushing NN above a few hundred in double precision is hopeless.

The two costs are visible side by side: the dense physical-space DND_N next to the almost-banded ultraspherical L\mathcal{L}.

Source
<Figure size 1000x450 with 2 Axes>

Physical-space collocation is the right tool when NN is moderate and the operator is well-conditioned. For stiff or high-order problems, or when NN has to grow large, the ultraspherical formulation pays off.

Higher-Order Operators

The construction above generalises cleanly to any order of derivative. A second derivative uu'' lives in C(2)C^{(2)}, requiring a sparse differentiation map D1:UC(2)\mathcal{D}_1: U \to C^{(2)} and a conversion S1:UC(2)\mathcal{S}_1: U \to C^{(2)}. A multiplication operator M2[a]M_2[a] acting on C(2)C^{(2)}-coefficients is built by the same three-term recurrence as M1[a]M_1[a], with the appropriate Gegenbauer recurrence in place of the Chebyshev one. For an equation of order kk, the discretisation lives in C(k)C^{(k)} and the resulting operator is again almost banded, with bandwidth determined by the differentiation order and the smoothness of the variable coefficients. The full theory, along with the analysis of conditioning and the optimal O(N)O(N) solver, is in Olver & Townsend (2013).

References
  1. Olver, S., & Townsend, A. (2013). A fast and well-conditioned spectral method. SIAM Review, 55(3), 462–489.