%
%  beam_data_entry_ms.m   ve 1.0   January 24, 2012
%
function[E,I,A,rho,ibc,ne,total_length,xv,dx,dof,node_int]=beam_data_entry_ms(i)
%
pm=0.;
xpm=0.;
disp(' ');
icross=input(' Enter the cross-section: \n 1=rectangle  2=solid cylinder  3=other ');
disp(' ');
if(icross==1)
			width=input(' Enter the width (inch) ');
			thick=input(' Enter the thickness (inch) ');
			A=width*thick;
			I=(1./12.)*width*(thick^3.);
end
if(icross==2)
			diam=input(' Enter the diameter (inch) ');
			A=(pi/4.)*(diam^2.);
			I=(pi/64.)*(diam^4.);
end
if(icross ~=1 & icross ~=2)
            disp(' ');
            I = input(' Enter the area moment of inertia (in^4) ');
            %
            disp(' ');
            A = input(' Enter the cross-section area (in^2) ');
end
%
disp(' ');
imat=input(' Enter material: \n 1=aluminum  2=steel  3=other ');
%
if(imat==1)
    rho=0.1;
	E=1.0e+07;
end
if(imat==2)
    rho=0.29;
    E=3.0e+007;
end
if(imat ~=1 & imat ~=2)
    disp(' ');   
    E = input(' Enter the elastic modulus (lbf/in^2) ');
    disp(' ');
    rho = input(' Enter the mass density (lbm/in^3) ');           
 end
%
rho=rho*A/386.;
%
disp(' ');
total_length = input(' Enter the total length (inch) ');
%
disp(' ');
disp(' Enter boundary conditions for endpoints ');
disp('  1=free-free ');
disp('  2=fixed-free ');
disp('  3=fixed-fixed ');
disp('  4=pinned-pinned ');
ibc=input(' ');
%
disp(' ');
disp(' Enter the number of intermediate pinned support points ');
isp=input(' ');
disp(' ');
disp(' The point locations are measured from the left boundary (inch). ');
disp(' ');
a=zeros(isp,1);
for i=1:isp
    out1=sprintf(' Enter the location of point %d ',i);
    disp(out1);
    a(i)=input(' ');
end
if(isp>=1)
    a=sort(a);
end
%
%
%  Recommend at least 16 elements to obtain reasonably accurate effective
%  modal mass values.
%
disp(' ');
ne = input(' Enter the number of elements ');
%
if(ne<(2.5*isp))
    ne=ceil(2.5*isp);
end
xv(1)=0.;
%
dxx=total_length/ne;
xv(1)=0.;
for i=2:(ne+1)
    xv(i)=xv(i-1)+dxx;
end
%
node_int=zeros(isp,1);
%
for j=1:isp
    rec=total_length;
    for i=1:(ne+1)
        if( abs(a(j)-xv(i))<rec )
            rec=abs(a(j)-xv(i));
            node_int(j)=i;
        end
    end
    xv(node_int(j))=a(j);
end
%
for i=1:ne
    dx(i)=xv(i+1)-xv(i);
end
%
dof=2*ne+2;