Eigenvibrations of a string
Introduction
Consider the following eigenvalue problem with appears in many papers, for example [3], [4], and [1]. In this introduction, we mainly follow the formulation in [4]. Find $\lambda > \kappa$ and a nonzero function $u:[0, 1] \to \mathbb{R}$ such that
\[\begin{align*} &-u''(x) = \lambda u(x), \\ &u(0) = 0,\ -u'(1) = \varphi(\lambda)u(1), \end{align*}\]
where $\varphi(\lambda) = \lambda \kappa M / (\lambda - \kappa)$ and $\kappa = K / M$ for given positive numbers $K$, $M$. This equation describes the eigenvibrations of a string with a load of mass $M$ attached by an elastic spring of stiffness $K$.
A finite element discretization of the eigenvalue problem with P1 element on subintervals of length $h = 1/n$ leads to the nonlinear eigenvalue problem
\[(\mathbf{A}_{1} + \varphi(\lambda)\mathbf{e}_{n} \mathbf{e}_{n}^{\mathrm{T}} - \lambda \mathbf{A}_{3}) \mathbf{u} = 0,\]
where
\[\mathbf{A}_{1} = \frac{1}{h} \begin{bmatrix} 2 & -1 & & \\ -1 & \ddots & \ddots & \\ & \ddots & 2 & -1 \\ & & -1 & 1 \end{bmatrix}, \ \mathbf{A}_{3} = \frac{h}{6} \begin{bmatrix} 4 & 1 & & \\ 1 & \ddots & \ddots & \\ & \ddots & 4 & 1 \\ & & 1 & 2 \end{bmatrix}\]
and $\mathbf{e}_{n}$ is the unit vector with $1$ on its $n$-th entry and $0$ on others.
For simplicity, we set $K = M = \kappa = 1$. Then $\varphi(\lambda)$ reduces to $\frac{\lambda}{\lambda - 1}$. We present computed eigenvalues with $n = 100$ and $n = 400$ in [4]. | $n$ | $\lambda_{1}$ | $\lambda_{2}$ | $\lambda_{3}$ | $\lambda_{4}$ | $\lambda_{5}$ | | :––-: | :––––––-: | :––––––-: | :––––––-: | :––––––-: | :––––––-: | | 100 | 4.4821765459 | 24.223573113 | 63.723821142 | 123.03122107 | 202.20089914 | | 400 | 4.4820338110 | 24.219005847 | 63.692138408 | 122.91317036 | 201.88234012 |
Contour integral method
In this section, we will use the contour integral method to solve the above nonlinear eigenvalue problem. First, we load Cim.
using Cim, SparseArrays
We use a function nep1
and nep2
to construct the discrete nonlinear eigenvalue problems for $n = 100$ and $n = 400$.
# n = 100
function nep1(z::ComplexF64)
d = 100
off_diag = -(d + z/(6 * d)) * ones(d - 1)
diag = (2 * d - 2 * z/(3 * d)) * ones(d)
diag[end] = 0.5 * diag[end] + z/(z - 1.0)
A = spdiagm(1 => off_diag, 0 => diag, -1 => off_diag)
return A
end;
# n = 400
function nep2(z::ComplexF64)
d = 400
off_diag = -(d + z/(6 * d)) * ones(d - 1)
diag = (2 * d - 2 * z/(3 * d)) * ones(d)
diag[end] = 0.5 * diag[end] + z/(z - 1.0)
A = spdiagm(1 => off_diag, 0 => diag, -1 => off_diag)
return A
end;
We set the number of the quadrature nodes and the number of columns of random chosen matrx.
# the number of the quadrature nodes
N = 30;
# the number of columns of random chosen matrx
l = 10;
We define the contour which is an ellipse with center $(150, 0)$ and same semi-major and semi-minor axes $148$:
elp = Cim.ellipse([150, 0], 148, 148)
Cim.ellipse([150.0, 0.0], 148.0, 148.0)
Finally, we use cim
to compute the eigenvalues inside the elp
. For $n = 100$, we get the eigenvalues $\lambda_{1}$:
λ₁ = cim(elp, nep1, 100, l; n=N)
5-element Vector{ComplexF64}:
4.482176539145632 + 9.224356227152844e-9im
24.223573112009547 + 8.008700649823976e-10im
63.72382114185238 + 8.760829273259041e-11im
123.03122106759191 + 1.4773565178810823e-11im
202.20089914355526 + 7.838825133721484e-12im
For $n = 400$, we get the eigenvalues $\lambda_{2}$:
λ₂ = cim(elp, nep2, 400, l; n=N)
5-element Vector{ComplexF64}:
4.482033785928927 + 2.2675942394047984e-9im
24.219005844979627 + 2.1531774825309866e-10im
63.69213840745538 + 6.894040209910698e-12im
122.9131703565338 + 2.3099097873645123e-11im
201.88234011806597 + 5.4082388107721034e-12im
This page was generated using Literate.jl.