disp(' ');
disp(' beam_multispan.m,  ver 1.0, January 24, 2012 ');
disp(' ');
disp(' by Tom Irvine ');
disp(' Email: tomirvine@aol.com ');
disp(' ');
disp(' This script calculates the natural frequencies of a multispan beam. ');
disp(' ');
%
close all
clear all
pm=0.;
%
i=1;
[E,I,A,rho,ibc,ne,total_length,xv,dx,dof,node_int]=beam_data_entry_ms(i);
%
[klocal] = local_stiffness(E,I,ne,dx);
[mlocal] = local_mass(rho,ne,dx);
%
[stiff,mass,dof,dof_status]=assembly_ms(ne,klocal,mlocal,ibc,dof,node_int,dx);
%
disp(' ');
%
[fn,omega,ModeShapes,MST]=Generalized_Eigen(stiff,mass,2);
%
mode=ModeShapes;
%
v=ones(dof,1);
%
disp(' ');
disp('        Natural    Participation    Effective  ');
disp('Mode   Frequency      Factor        Modal Mass ');
%    
%  The accuracy decreases with mode number.
%
    LM=mode'*mass*v;
    pf=LM;
    sum=0;
%    
    mmm=mode'*mass*mode;   
%  
    for i=1:dof
        pff(i)=pf(i)/mmm(i,i);
        emm(i)=pf(i)^2/mmm(i,i);
        if(emm(i) < rho*total_length/100000.)
            emm(i)=0.;
            pff(i)=0.;
        end
        out1 = sprintf('%d  %10.4g Hz   %10.4g   %10.4g',i,fn(i),pff(i),emm(i) );
        disp(out1)
        sum=sum+emm(i);
    end
%
disp(' ')
out1 = sprintf(' Total Effective Modal Mass = %10.4g lbf sec^2/in',sum );
disp(out1)
%
disp(' ')
out1 = sprintf(' Total Mass = %10.4g lbf sec^2/in',(pm + rho*total_length) );
disp(out1)
out1 = sprintf('            = %10.4g lbm',(pm*386 + rho*total_length*386. ));
disp(out1)
%
[pmode]=plot_modes_ms(dof_status,mode,dof,xv,fn);