MATH661 Homework 9 - Linear operator approximation

Posted: 11/17/21

Due: 11/24/21, 11:55PM

1Track 1

  1. Review the construction of Fig.01 and Fig. 02 in L02. Construct convergence plots for the approximation of f'(π/4), f(x)=sin(cos(x))+cos(sin(x)) using truncations to orders 𝒪(hp), p=1,2,3,4 using the forward finite difference operator Δf(x)=f(x+h)-f(x)

    ddt=1h(Δ-12Δ2+13Δ3+14Δ4-).

    Solution.

    Define finite difference operators

  2. Use the polynomial interpolation error formula to find the error

    e=|I(f)-Q(f)|=(b-a)312f''(ξ),a<ξ<b,

    of the trapezoid quadrature rule

    I(f)=abf(t)dtQ(f)=b-a2(f(a)+f(b)).

    Construct a convergence plot of the error

    e(h)=k=1n|xk-1xkf(t)dt-h2(fk-1+fk)|,

    with h=1/n, fk=f(xk), xk=kh in approximating the integral

    01etcos(πt)dt
  3. Repeat the above for the Simpson rule

    Q(f)=b-a6(f(a)+4f(a+b2)+f(b)).
  4. Extra credit (3 points). Repeat the above for Gauss-Legendre quadrature of orders 2 and 3. Note that each subinterval over which you apply a Gauss quadrature rule has to be mapped to [-1,1].

2Track 2

  1. The expansion of the differentiation operator in terms of the forward finite difference operator arise from

    ddt=1hln(E+Δ)

    and leads to the series

    ddt=1h(Δ-12Δ2+13Δ3+14Δ4-).

    Deduce the analogous series that arises from

    ddt=2harcsinh(δ2),

    with δ the central finite difference operator

    δf(x)=f(x+h/2)-f(x-h/2)2.

    Construct convergence plots for the approximation of f'(π/4), f(x)=sin(cos(x))+cos(sin(x)) using p=1,2,3 terms from both above series. Compare with the behavior of Fig. 02, L02, and comment.

  2. Romberg integration is a combination of trapezoid quadrature over decreasing subintervals and Aitken extrapolation. Implement Romberg integration and test on

    01etcos(πt)dt.

    What is the observed order of convergence?

  3. Review Lesson 37, “From Lanczos to Gauss Quadrature” of Trefethen & Bau. Compute the roots of the first 10 Legendre polynomials by finding the eigenvalues of the associated Jacobi matrices.

  4. Extra credit (3points). Construct a recursive function RecInt(a,b,err,f,Q) that has arguments scalars a,b,err and functions f,Q and approximates

    I(f)=abf(t)dt

    through repeated application of quadrature rule Q(f,a,b) according to the algorithm

    Algorithm

    Recursive quadrature

    RecInt(a,b,err,f,Q)

    c=a+(b-a)/2

    Qab=Q(f,a,b);Qac=Q(f,a,c);Qcb=Q(f,c,b)

    e=|Qac+Qcb-Qab|/|Qac+Qcb|

    if e<err

    return Qac+Qcb

    else

    return RecInt(a,c,err,f,Q)+RecInt(c,b,err,f,Q)

    Test the recursive integration procedure with trapezoid, Simpson, and Gauss-Legendre rules of orders 2,3,4 on the integral

    -11cos(1t).