function[E,I,A,rho,ibc,ne,total_length,xv,dx,dof,ipm,pm,xpm]=beam_data_entry(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 length (inch) '); % % 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 '); disp(' 1=free-free '); disp(' 2=fixed-free '); disp(' 3=fixed-fixed '); disp(' 4=pinned-pinned '); ibc=input(' '); % % 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 % dxx=total_length/ne; xv(1)=0.; for i=2:(ne+2) xv(i)=xv(i-1)+dxx; end for i=1:(ne+1) dx(i)=xv(i+1)-xv(i); 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;