First-order differentiation
matrix. Accurate eigenvalue approximations can be obtained even
when continuum boundary conditions are not exactly represented in the
discrete formulation. Repeat the above discretization ,
,
for the first-order differentiation operator
with eigenvalues associated with
eigenfunctions
The derivative may be approximated by
|
(1) |
The eigenproblem
differs from the discretization (1)
hence
 |
|
Figure 1. Comparison of eigenvalues of
second-order differentiation matrix
(blue circles) with those
|
∴ |
m=8; o=ones(m-1,1)[:,1]; D=diagm(-1 => -o, 1 => o) |
|
(2) |
∴ |
function ErrorλD(m)
h=π/m; o=ones(m-1,1)[:,1]; D=diagm(-1 => o, 1 => o)-2*I;
λ=sort(eigvals(D),rev=true);
ε=norm(λ.+4*sin.(collect(1:m).*h/2).^2)/norm(λ)
end; |
∴ |
ε=ErrorλD.(20:20:100)'; |
∴ |
print(round.(ε; digits=3)) |
[0.0480 0.0240 0.0160 0.0120 0.0100]