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.

p02: Convergence of periodic spectral method

We repeat program P1 using periodic spectral method to compute derivative of

u(x)=exp⁡(sin⁡(x)),x∈[−π,π]u(x) = \exp(\sin(x)), \qquad x \in [-\pi,\pi]
<Figure size 640x480 with 1 Axes>

With about 24 points, the error is of order 10-12, compare this to the finite difference method in p01.

Exercise

A Toepliz matrix is generated by its first column and first row. In the present case, we could also do

D = toeplitz(col, -col)