function[EI,rho,ibc,ne,total_length,xv,dx,dof,ipm,pm,xpm]=rocket_bending_data_entry(EIF,MF)
%
pm=0.;
xpm=0.;
disp(' ');
%
mass_x=MF(:,1);
mass_y=MF(:,2);
%
EI_x=EIF(:,1);
EI_y=EIF(:,2);
%
max1=max(mass_x);
max2=max(EI_x);
%
min1=min(mass_x);
min2=min(EI_x);
%
maximum=max1;
if(max2 < max1 )
    maximum=max2;
end
minimum=min1;
if(min2 > min1 )
    minimum=min2;
end
%
total_length = maximum-minimum;
%
%  Recommend at least 16 elements to obtain reasonably accurate effective
%  modal mass values.
%
disp(' ');
ne = input(' Enter the number of elements ');
%
if(ne > 100) 
    ne=100;
end
%
disp(' ');
disp(' Enter boundary conditions (Typically free-free)');
ibc=input(' 1=free-free 2=fixed-free 3=fixed-fixed  4=pinned-pinned ');
%
dxx=total_length/ne;
xv(1)=0.;
for i=2:(ne+1)
    xv(i)=xv(i-1)+dxx;
    inum=i;
end
%
disp(' ');
disp(' Specify node locations for INS, TVC, etc? ');
idn=input(' 1=yes  2=no ');
if(idn==1)
    disp(' ')
    isn=input(' How many specific nodes? ');    
    for i=1:isn
        xv(inum+1)=input(' input node position ');
        inum=inum+1;
    end
end
%
xv=sort(xv);
%
ne = length(xv)-1;
%
j=1;
for i=1:ne
    if(  (xv(i+1)-xv(i)) > total_length/10000.)
        dx(j)=xv(i+1)-xv(i);
        j=j+1;
    end
end
%
xv(1)=0.;
for i=2:(ne+1)
    xv(i)=xv(i-1)+dx(i-1);
end
%
disp(' ');
disp(' Enter point mass? ');
ipm=input(' 1=yes  2=no ');
if(ipm==1)
   xpm= input(' What is the distance of the point mass from the left boundary ?');
   disp(' ');
   pm= input(' What is the point mass (lbm)?');
   pm=pm/386.;
end
%
iflag=0;
if(ipm==1)
    for i=1:(ne+1)
      if( abs(xpm-xv(i))< total_length/1000.)
          xpm=xv(i);
          iflag=1;
          break;
      end
    end
end
if(ipm==1 & iflag==0)
    xv(ne+2)=xpm;
    temp=sort(xv);
    num=max(size(temp));
    num=num-1;
    for i=1:num
        dx(i)=temp(i+1)-temp(i);
    end    
    ne=ne+1;
end
dof=2*ne+2;
%
for i=1:ne
    rho(i)=0.;
    EI(i)=0.;
end    
for i=1:ne
    k=0;
    sum=0.;
    nearest_mass=0.;
    nx=total_length;
    for j=1:length(mass_x)
        if( mass_x(j) >= xv(i) & mass_x(j) <= xv(i+1) )
            k=k+1;
            sum=sum+mass_y(j);
        end
        xx=( xv(i+1) + xv(i) )/2.;
        if( abs(xx-mass_x(j)) < nx )
            nx=abs(xx-mass_x(j));
            nearest_mass=mass_y(j);
        end
    end
    if(k>0)
        rho(i)=sum/k;
    else
        rho(i)=nearest_mass;
    end 
    rho(i)=rho(i)/386.;
end
%
for i=1:ne
    k=0;
    sum=0.;
    nearest_EI=0.;
    nx=total_length;
    for j=1:length(EI_x)
        if( EI_x(j) >= xv(i) & EI_x(j) <= xv(i+1) )
            k=k+1;
            sum=sum+EI_y(j);
        end
        xx=( xv(i+1) + xv(i) )/2.;
        if( abs(xx-EI_x(j)) < nx )
            nx=abs(xx-EI_x(j));
            nearest_EI=EI_y(j);
        end
    end
    if(k>0)
        EI(i)=sum/k;    
    else
        EI(i)=nearest_EI;    
    end 
end