I try to solve Euler-Bernoulli Beam with Galerkin method, being clamped at one side and being free at the other to find the natural frequencies of vibration.
I assume the solution field as follows with my trial functions:
$$ w(x,t) = \phi_i(x) q_i(t) $$
$$ \phi_i(x) = \left( \frac{x}{L} \right) ^{i+1} \qquad i=1,...,n $$
The trial functions satisfy the essential (geometric) boundary conditions such that:
$$ \phi_i(0) = 0 \qquad \phi_i^\prime(0) = 0 $$
The mass (M) and stiffness (K) matrices are defined for Euler-Bernoulli Beam as follows:
$$ M_{ij} = \int_0^L \rho A \phi_i(x) \phi_j(x) dx = \rho A L \frac{1}{i+j+3}$$
$$ K_{ij} = \int_0^L EI \phi_i^{\prime \prime}(x) \phi_j^{\prime \prime} (x) dx = \frac{EI}{L^3} \frac{(i+1)(i)(j+1)(j)}{i+j-1} $$
The eigenvalue problem is the following type:
$$ det(K - \omega^2 M ) = 0 $$
where $ \lambda = \omega^2 $. This works perfectly well until $ i = 10$. However, if I increase the number of the trial functions, the eigenvalue problem yields inconsistent results with the analytical solution.
As far as I know, mass matrix should be positive definite by definition. However, even for $i=5$ eigenvalues of mass matrix yields values very close to zero, yet still rank being 5. As I said, after increasing $i$ to higher values, the rank of mass matrix also drops yielding absurd results.
What part do I miss here? Thank you.