KK = 4e2;  m = 1;
nnodes = 29; % number of nodes of the bridge
[ A ] = bridge_stiffness_matrix( nnodes, KK );
n = size( A, 2 );
M = m * speye( n, n );
nr = n - 3;
ir = [ 3 : n - 1 ];
Ar = A( ir, ir );
Mr = M( ir, ir );
K_Ar = condest( Ar )
%   K_Ar =
%      1.8838e+04
K_Mr = condest( Mr )
%   K_Mr =
%      1
        
neig = 10;
[ Xr, Lr ] = eigs( Ar, Mr, neig, 'SM' );
lambda_r = diag( Lr )'
%   lambda_r =
%      0.1758    2.2183    4.3588   10.3889   24.5227   38.0159
%      49.2831   79.0215  102.4560  120.2148
X = zeros( n, neig );
X( ir, : ) = Xr( :, : );

viz_fact = 3;  % rescale facror for visualization of the eigenmodes
% first eigenmode, lambda = 0.1758
[ fig_h ] = plot_bridge( nnodes, viz_fact * X( :, 1 ) )
% fourth eigenmode, lambda = 10.3839  
[ fig_h ] = plot_bridge( nnodes, viz_fact * X( :, 4 ) )
% seventh eigenmode, lambda = 49.2831
[ fig_h ] = plot_bridge( nnodes, viz_fact * X( :, 7 ) )
% tenth eigenmode, lambda = 120.2148 
[ fig_h ] = plot_bridge( nnodes, viz_fact * X( :, 10 ) )