A1451 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A14 · Lesson 51 · Lab: fixed points, operators and Fourier means

Stopping rules, Gronwall against reality, matrix norms, worst-case inputs and Fejér means

The last third of the course moved into spaces of functions and operators: contractions and Picard iteration, Gronwall's inequality, operator norms, Fourier series and their Fejér means. In this lab you'll run each one. You'll stop a contraction with an a posteriori bound, measure how far two ODE solutions actually separate against Gronwall's guarantee, compute matrix norms three ways, build the input that drives a filter to its worst-case output, and compare Fejér means with plain partial sums at a jump.

  • A filter with impulse response h[n]=0.8ncos⁡πn3 is driven by inputs bounded by 1.
  • The worst input sets each sample to the sign of the matching tap, x[n−k]=sign(h[k]), so that every term in the convolution adds.
  • The readout gives the resulting output, ∑|h[k]|, which you'll reproduce in the lab: no bounded input can do better.

Predict

Two solutions of y˙=sin⁡y+t start 0.01 apart. Gronwall allows their gap to reach 0.20 by t = 3. What does an accurate simulation show?

Name it

A posteriori stopping

For a contraction with constant q, stop when q1−q|xn−xn−1| falls below the tolerance: that bounds the true error of xn (lesson 33).

Matrix norms in NumPy

np.linalg.norm(A, 1), np.linalg.norm(A, np.inf) and np.linalg.norm(A, 2) give the induced 1-, ∞- and 2-norms (largest column sum, largest row sum, largest singular value).

Worst-case inputs

For a convolution, the output sample y[n]=∑kh[k]x[n−k] is largest when x[n−k]=sign(h[k]), which achieves ∑|h[k]|, the ℓ1 norm. That's the operator norm on bounded signals, constructed explicitly.

Fejér means in code

Weight harmonic k by 1−kN (lesson 42) and sum. Compare maxima near a jump with the plain partial sum.

Worked example

Iterate T(x)=12cos⁡x from 0 until two successive iterates differ by less than 10−10. How many steps, and how accurate is the result?

Show the solution
  1. Iterate. Sixteen steps reach |x16−x15|<10−10, at x=0.4501836113
  2. The a posteriori bound. With q = ½, q1−q|xn−xn−1|<10−10 so the result is guaranteed to that accuracy.
  3. The actual rate. It's better than q: near the fixed point |T′|=12sin⁡(0.45)=0.22 so each step gains about 0.66 digits.
  4. Compare the a priori bound. It assumes the worst rate from the start, and would ask for 34 steps.

Answer 16 steps, giving x = 0.4501836113, guaranteed to within 10−10.

Worked example

Compute ‖A‖1, ‖A‖∞ and ‖A‖2 for A=(1−234) with NumPy, and check them against lesson 38.

Show the solution
  1. NumPy. It gives 6, 7 and 5.11667.
  2. By hand. The largest column sum is |−2|+4=6, the largest row sum 3+4=7, and the 2-norm is 15+125=5.11667
  3. Compare with the spectral radius. All three bound the spectral radius 10=3.162 from above, as any operator norm must, and here the 2-norm is the tightest of them. For a symmetric matrix it would equal the spectral radius exactly.

Answer ‖A‖1=6, ‖A‖∞=7 and ‖A‖2=5.11667, matching lesson 38.

Check

A contraction with q = 0.6 just took a step of 1 × 10⁻⁵. What bound does that give on the current error?

Check

Gronwall's bound for two solutions starting 0.01 apart, Lipschitz constant 1, at t = 3?

Check

Iterate T(x)=12cos⁡x from 0 until |xn−xn−1|<10−10. Set steps and x.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Write rk4(f, y, T, steps) for a scalar ODE from t = 0. Integrate y˙=sin⁡y+t to T = 3 with 3000 steps from y(0) = 0 and from y(0) = 0.01. Set gap to their final difference and bound to Gronwall's 0.01e3.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

For A=(1−234), set n1, ninf and n2 with np.linalg.norm, and rho to the largest absolute eigenvalue.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

For h[n]=0.8ncos⁡πn3, n = 0 to 59, build the worst-case input (the signs of h, reversed in time) and set y to the output it produces at the last moment, ∑kh[k]sign(h[k]); set l1 to ∑|h|.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

On 20 001 points of (0, π], set partial to the largest value of the square wave's partial sum 4π∑k odd<50sin⁡kxk and fejer to the largest value with each term weighted by 1−k50.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Explain why

Why is Gronwall's bound usually far from the actual separation of two solutions?

Practice

Keep practicing

3 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.