function varargout = BR(varargin) % BR M-file for BR.fig % BR, by itself, creates a new BR or raises the existing % singleton*. % % H = BR returns the handle to a new BR or the handle to % the existing singleton*. % % BR('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in BR.M with the given input arguments. % % BR('Property','Value',...) creates a new BR or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before BR_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to BR_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help BR % Last Modified by GUIDE v2.5 01-Jun-2009 15:08:22 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @BR_OpeningFcn, ... 'gui_OutputFcn', @BR_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before BR is made visible. function BR_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to BR (see VARARGIN) %text(-0.1,-0.1,'This is \omega'); if(get(handles.TFFlist,'value')==3)&&(get(handles.SFF,'value')~=1) set(handles.FRtext,'visible','on'); set(handles.FRstring,'visible','on'); else set(handles.FRtext,'visible','off'); set(handles.FRstring,'visible','off'); end if(get(handles.SFFlist,'value')==1) set(handles.TFFtext,'visible','off'); set(handles.TFFlist,'visible','off'); set(handles.Aotext,'visible','off'); set(handles.AoString,'visible','off'); else set(handles.TFFtext,'visible','on'); set(handles.TFFlist,'visible','on'); set(handles.Aotext,'visible','on'); set(handles.AoString,'visible','on'); end if(get(handles.SFFlist,'value')==2) set(handles.ALtext,'visible','on'); set(handles.ALstring,'visible','on'); else set(handles.ALtext,'visible','off'); set(handles.ALstring,'visible','off'); end % Choose default command line output for BR handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes BR wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = BR_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on selection change in BClist. function BClist_Callback(hObject, eventdata, handles) % hObject handle to BClist (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns BClist contents as cell array % contents{get(hObject,'Value')} returns selected item from BClist % --- Executes during object creation, after setting all properties. function BClist_CreateFcn(hObject, eventdata, handles) % hObject handle to BClist (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: listbox controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in SFFlist. function SFFlist_Callback(hObject, eventdata, handles) % hObject handle to SFFlist (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns SFFlist contents as cell array % contents{get(hObject,'Value')} returns selected item from SFFlist if(get(handles.SFFlist,'value')==1) set(handles.TFFtext,'visible','off'); set(handles.TFFlist,'visible','off'); set(handles.Aotext,'visible','off'); set(handles.AoString,'visible','off'); set(handles.NCtext,'visible','on'); set(handles.NCstring,'visible','on'); set(handles.FRtext,'visible','off'); set(handles.FRstring,'visible','off'); else set(handles.TFFtext,'visible','on'); set(handles.TFFlist,'visible','on'); set(handles.Aotext,'visible','on'); set(handles.AoString,'visible','on'); set(handles.NCtext,'visible','off'); set(handles.NCstring,'visible','off'); if(get(handles.TFFlist,'value')==3) set(handles.FRtext,'visible','on'); set(handles.FRstring,'visible','on'); else set(handles.FRtext,'visible','off'); set(handles.FRstring,'visible','off'); end end if(get(handles.SFFlist,'value')==2) set(handles.ALtext,'visible','on'); set(handles.ALstring,'visible','on'); else set(handles.ALtext,'visible','off'); set(handles.ALstring,'visible','off'); end % --- Executes during object creation, after setting all properties. function SFFlist_CreateFcn(hObject, eventdata, handles) % hObject handle to SFFlist (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: listbox controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in TFFlist. function TFFlist_Callback(hObject, eventdata, handles) % hObject handle to TFFlist (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns TFFlist contents as cell array % contents{get(hObject,'Value')} returns selected item from TFFlist if(get(handles.TFFlist,'value')==3) set(handles.FRtext,'visible','on'); set(handles.FRstring,'visible','on'); else set(handles.FRtext,'visible','off'); set(handles.FRstring,'visible','off'); end % --- Executes during object creation, after setting all properties. function TFFlist_CreateFcn(hObject, eventdata, handles) % hObject handle to TFFlist (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: listbox controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function DRstring_Callback(hObject, eventdata, handles) % hObject handle to DRstring (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of DRstring as text % str2double(get(hObject,'String')) returns contents of DRstring as a double % --- Executes during object creation, after setting all properties. function DRstring_CreateFcn(hObject, eventdata, handles) % hObject handle to DRstring (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function FRstring_Callback(hObject, eventdata, handles) % hObject handle to FRstring (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) value = str2num(get(handles.FRstring,'string')); zeta1 = str2num(get(handles.DRstring,'string')); if(value==1)&(zeta1==0) set(handles.FRstring,'string','0'); errordlg('When there is zero damping f/f1 cannot be unity','Error'); end handles.output = hObject; guidata(hObject, handles); % Hints: get(hObject,'String') returns contents of FRstring as text % str2double(get(hObject,'String')) returns contents of FRstring as a double % --- Executes during object creation, after setting all properties. function FRstring_CreateFcn(hObject, eventdata, handles) % hObject handle to FRstring (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in SPlist. function SPlist_Callback(hObject, eventdata, handles) % hObject handle to SPlist (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns SPlist contents as cell array % contents{get(hObject,'Value')} returns selected item from SPlist % --- Executes during object creation, after setting all properties. function SPlist_CreateFcn(hObject, eventdata, handles) % hObject handle to SPlist (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: listbox controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in CRbutton. function CRbutton_Callback(hObject, eventdata, handles) % hObject handle to CRbutton (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) BC = get(handles.BClist,'value'); LT = get(handles.SFFlist,'value'); FF = get(handles.TFFlist,'value'); zeta1 = str2num(get(handles.DRstring,'string')); aoverL = str2num(get(handles.ALstring,'string')); foverf1 = str2num(get(handles.FRstring,'string')); BCtext = strcat(get(handles.BClist,'string'),' Boundary Contitions'); Q = get(handles.NCstring,'string'); QV = str2num(Q); if LT==1 FF=-1; end aoverL1=fix(100*(aoverL))+1; if ((FF==2)|(FF==3))&(LT==2) ylabeltext='Displacement, \muL\omega_1^2y(x,t)/A_0'; %disp(' Ao has units of force.') AoUnits = 'force'; elseif ((FF==2)|(FF==3))&(LT==3) ylabeltext='Displacement, \mu\omega_1^2y(x,t)/A_0'; %disp(' Ao has units of force/length.') AoUnits = 'force/length'; elseif (FF==1)&(LT==2) ylabeltext='Displacement, \muL\omega_1y(x,t)/A_0'; %disp(' Ao has units of force*time.') AoUnits = 'force*time'; elseif (FF==1)&(LT==3) ylabeltext='Displacement, \mu\omega_1y(x,t)/A_0'; %disp(' Ao has units of force*time/length.') AoUnits = 'force*time/length'; end if LT~=1 set(handles.AoString,'string',AoUnits); end if FF==3 xlabeltext='Time, \omegat'; else xlabeltext='Time, \omega_1t'; end %if FF==-1 if LT==1 ylabeltext='Displacement, y(x,t)/y_m_a_x'; end if FF==1<==2 fflabel=['A_0\delta(x - ' num2str(aoverL) 'L)\delta(t)']; elseif FF==1<==3 fflabel='A_0\delta(t)'; elseif FF==2<==2 fflabel=['A_0\delta(x - ' num2str(aoverL) 'L)u(t)']; elseif FF==2<==3 fflabel='A_0u(t)'; elseif FF==3<==2 fflabel=['A_0\delta(x - ' num2str(aoverL) 'L)cos(\omegat)']; elseif FF==3<==3 fflabel='A_0cos(\omegat)'; end BetaL=zeros(4,5); Alpha=zeros(4,5); BetaL(1,:)=pi*[1 2 3 4 5]; BetaL(2,:)=[1.8751041 4.69409113 7.85475743 10.99554074 14.13716839]; BetaL(3,:)=[3.9266023 7.06858275 10.21017613 13.35176878 16.49336143]; BetaL(4,:)=[4.7300408 7.8532046 10.9956078 14.1371655 17.2787596]; Alpha(2,:)=[.7340955 1.01846644 .99922450 1.000033553 .9999985501]; Alpha(3,:)=[1.0007773 1.00000144 1. 1. 1.]; Alpha(4,:)=[.9825022158 1.000777311 .9999664501 1.00000145 .9999999373]; alpha=Alpha(BC,:); betaL=BetaL(BC,:); betaL4=betaL.^4; fioverf1=(betaL.*betaL)/(betaL(1,1)^2); xoverL=linspace(0,1,101); phi=zeros(5,101); sqrt2=sqrt(2); f=zeros(1,5); if BC==1 for i=1:5 phi(i,:)=sqrt2*sin(i*pi*xoverL); end else for i=1:5 z=betaL(1,i)*xoverL; phi(i,:)=cosh(z)-cos(z)-alpha(1,i)*(sinh(z)-sin(z)); end end if LT~=1 q0=zeros(1,5); else q0=QV; end if LT==1|LT==3 aoverL1=0; end if FF~=3 foverf1=1.5; end [Y,ymax,tau1,fdioverf1]=response(phi,LT,FF,zeta1,fioverf1,aoverL1,q0,foverf1); yclampl=[-1 1 .5 .1 -.3 -.5 -1]*ymax*.45; yclampr=.49*ymax*[ .4 -.4 -.4 .4 .4]; xclampl=[0 0 -.08 -.06 -.09 -.05 0]*1.6; xclampr=[1 1 1.15 1.15 1]; xsptr=[1 1.15 1.1 1.04 1 1]; ysptr1=.49*ymax*[.53 .53 .83 .78 .9 .53]; ysptr2=-ysptr1; xbearing=[1.03 1.12 1.03 1.12]; ybearing=.49*ymax*[.47 .47 -.47 -.47]; if FF==2 low=-.5*ymax; else low=-1.5*ymax; end xarrow=[0 0 .03 -.03 0]; yarrow=[.4*low 0 .08*low .08*low 0]; xoverL1=[0 .25 .5 .75 1]; PT = get(handles.SPlist,'value'); if PT ==1 %figure(1);clf reset;%plot normal modes cla reset axis([0 1 -2.2 2.2]) hold on box on %for i=1:5 % plot(xoverL,phi(i,:)); % hold on % plot([.1 .2],[phi(i,11) -(.4+.3*i)],'k') % text(.21 ,-(.4+.3*i),['i = ' num2str(i)]) %end plot(xoverL,phi(1,:),xoverL,phi(2,:),xoverL,phi(3,:),... xoverL,phi(4,:),xoverL,phi(5,:),'LineWidth',2) legend('i = 1', 'i = 2', 'i = 3', 'i = 4', 'i = 5'); %ext(.05,2.05,['Eigenfunctions for ' BCtext]) xlabel('Distance, x/L') ylabel('\phi_i(x)') %text(.05,-2.1,'Press Enter to Continue'); hold off %pause elseif PT ==2 %figure(2);clf reset% do animation cla reset %h1=axes('Ydir','reverse'); set(handles.axes1,'ydir','reverse'); axis([-.2 1.2 low 1.5*ymax]); hold on box on xlabel('Distance, x/L'); ylabel(ylabeltext); if BC==1 patch(xclampl,yclampl,'r'); patch(xclampr,yclampr,'r'); patch(xsptr,ysptr1,'r'); patch(xsptr,ysptr2,'r'); plot(xbearing, ybearing, 'o','Color','k','LineWidth',[1.5]) plot([0 1],[0 0],'o','Color','r'); end if BC==2 patch(xclampl,yclampl,'r'); plot([-.05 0],[0 0],'Color','k','LineWidth',[4.5]); end if BC==3 patch(xclampl,yclampl,'r'); patch(xclampr,yclampr,'r'); patch(xsptr,ysptr1,'r'); patch(xsptr,ysptr2,'r'); plot(xbearing, ybearing, 'o','Color','k','LineWidth',[1.5]) plot([-.05 0],[0 0],'Color','k','LineWidth',[4.5]); plot([ 1],[ 0],'o','Color','r'); end if BC==4 patch(xclampl,yclampl,'r'); patch(xclampr,yclampr,'r'); patch(xsptr,ysptr1,'r'); patch(xsptr,ysptr2,'r'); plot(xbearing, ybearing, 'o','Color','k','LineWidth',[1.5]) plot([-.05 0],[0 0],'Color','k','LineWidth',[4.5]); plot([1 1.05],[0 0],'Color','k','LineWidth',[4.5]); end box on if LT==2 plot(xarrow+aoverL*ones(1,5),2*yarrow); text(aoverL,2.1*yarrow(1,1),fflabel) elseif(LT==3) for i=1:5 plot(xarrow+ones(1,5)*xoverL1(1,i),yarrow); plot([0 1],[.4*low .4*low]); end text(.2,1.2*yarrow(1,1),fflabel) end if FF==3|LT==1 data1=Y(1,:); else data1=zeros(1,101); end L=plot(xoverL,data1,'k','EraseMode','xor','LineWidth',[3.5]); thandl=text(-.1,1.2*ymax,'Press Enter to Animate'); text(.6,1.2*ymax,['\omega_1=(' num2str(betaL(1,1)^2) '/L^2)sqrt(EI/\mu)']) text(.6,1.4*ymax,['\zeta_1 = ' num2str(zeta1)]); if LT==2 text(-.1, 1.4*ymax,['a/L = ' num2str(aoverL)]); end if FF==3 text(.9,1.4*ymax,['\omega/\omega_1 = ' num2str(foverf1)]); end hold on pause(1.0); %clf %h1=axes('Ydir','reverse'); set(handles.axes1,'ydir','reverse'); cla axis([-.2 1.2 low 1.5*ymax]); hold on ylabel(ylabeltext); xlabel('Distance, x/L'); if BC==1 patch(xclampl,yclampl,'r'); patch(xclampr,yclampr,'r'); patch(xsptr,ysptr1,'r'); patch(xsptr,ysptr2,'r'); plot(xbearing, ybearing, 'o','Color','k','LineWidth',[1.5]) plot([0 1],[0 0],'o','Color','r'); end if BC==2 patch(xclampl,yclampl,'r'); plot([-.05 0],[0 0],'Color','k','LineWidth',[4.5]); end if BC==3 patch(xclampl,yclampl,'r'); patch(xclampr,yclampr,'r'); patch(xsptr,ysptr1,'r'); patch(xsptr,ysptr2,'r'); plot(xbearing, ybearing, 'o','Color','k','LineWidth',[1.5]) plot([-.05 0],[0 0],'Color','k','LineWidth',[4.5]); plot([ 1],[ 0],'o','Color','r'); end if BC==4 patch(xclampl,yclampl,'r'); patch(xclampr,yclampr,'r'); patch(xsptr,ysptr1,'r'); patch(xsptr,ysptr2,'r'); plot(xbearing, ybearing, 'o','Color','k','LineWidth',[1.5]) plot([-.05 0],[0 0],'Color','k','LineWidth',[4.5]); plot([1 1.05],[0 0],'Color','k','LineWidth',[4.5]); end box on text(.6,1.2*ymax,['\omega_1=(' num2str(betaL(1,1)^2) '/L^2)sqrt(EI/\mu)']) hold on text(.6,1.4*ymax,['\zeta_1 = ' num2str(zeta1)]); if LT==2 text(-.1, 1.4*ymax,['a/L = ' num2str(aoverL)]); end if FF==3 text(.9,1.4*ymax,['\omega/\omega_1 = ' num2str(foverf1)]); end L1=plot(xoverL,Y(1,:),'k','EraseMode','xor','LineWidth',[4.5]); thandl1=text(-.1,1.2*ymax,' '); for i=1:401 set(L1,'YData',Y(i,:)); pause(.03) end %set(thandl1,'String','Press Enter to Continue'); hold off %pause elseif PT ==3 %figure(3);clf reset% y(x,t) vs t for several x cla reset set(handles.axes1,'ydir','reverse'); %h1=axes('Ydir','reverse'); hold on if FF==2 low=-.2*ymax; else low=-1.5*ymax; end axis([0 tau1(1,401) low 1.5*ymax]); hold on box on xlabel(xlabeltext); ylabel(ylabeltext); Nplot=3; if BC==2 Nplot=4; end xoverL1=[.25 0.5 0.75 1]; hist=[26 51 76 101]; %for i=1:Nplot % plot(tau1,Y(:,hist(1,i))); % hold on % plot([8 10.9],[Y(161,hist(1,i)),Y(161,hist(1,i))+.2*(ymax+.8*i)],'k'); % text(11,Y(161,hist(1,i))+.2*(ymax+.8*i),['x/L = ' num2str(xoverL1(1,i))]); %end %pause (1.0); if Nplot == 3 plot(tau1,Y(:,hist(1,1)),tau1,Y(:,hist(1,2)),tau1,Y(:,hist(1,3)),... 'LineWidth',2); legend(['x/L = ', num2str(xoverL1(1,1))],['x/L = ', num2str(xoverL1(1,2))],... ['x/L = ' num2str(xoverL1(1,3))]); else plot(tau1,Y(:,hist(1,1)),tau1,Y(:,hist(1,2)),tau1,Y(:,hist(1,3)),... tau1,Y(:,hist(1,4)),'LineWidth',2); legend(['x/L = ', num2str(xoverL1(1,1))],['x/L = ', num2str(xoverL1(1,2))],... ['x/L = ', num2str(xoverL1(1,3))],['x/L = ' num2str(xoverL1(1,4))]); end if LT==2 text(2, 1.43*ymax,['\zeta_1 = ' num2str(zeta1) ' a/L = ' num2str(aoverL)]); else text(2,1.43*ymax,['\zeta_1 = ' num2str(zeta1)]) end %text(2,1.2*ymax,'Press Enter to Continue'); hold off %pause elseif PT ==4 %figure(4);clf reset cla reset set(handles.axes1,'ydir','reverse'); %h1=axes('Ydir','reverse'); if FF==2 low=-.2*ymax; else low=-1.5*ymax; end axis([0 1 low 1.5*ymax]); hold on box on xlabel(xlabeltext); ylabel(ylabeltext); %for t=1:24:121 % plot(xoverL, Y(t,:)); % hold on %end plot(xoverL,Y(1,:),xoverL,Y(25,:),xoverL,Y(49,:),... xoverL,Y(73,:),xoverL,Y(97,:),xoverL,Y(121,:),... 'linewidth',2.0); tvals=[0 24 48 72 96 120]/400; if FF==3 tstr='\omegat = '; else tstr='\omega_1t = '; end %for j=1:6 % text(.8,ymax*(1.4-j*.15),[tstr num2str(tvals(1,j))]); % plot([.44 .79],[Y(1+(j-1)*24,45) ymax*(1.4-j*.15)],'k'); %end legend([tstr, num2str(tvals(1,1))],[tstr, num2str(tvals(1,2))],... [tstr, num2str(tvals(1,3))],[tstr num2str(tvals(1,4))],... [tstr, num2str(tvals(1,5))],[tstr num2str(tvals(1,6))]); xlabel('Distance, x/L'); ylabel(ylabeltext) if LT==2 text(.45, 1.35*ymax,['\zeta_1 = ' num2str(zeta1) ' a/L = ' num2str(aoverL)]); else text(.45, 1.35*ymax,['\zeta_1 = ' num2str(zeta1)]) end hold off %text(.05,1.35*ymax,'Press Enter to Continue'); %pause else %figure(5);clf reset;%3-D plot of y(x,t) vs x and t. cla reset %h4=axes('ZDir','reverse'); set(handles.axes1,'zdir','reverse'); axis([0 1 0 20 low 1.5*ymax]); hold on tau2=linspace(0,20,201); [X,T]= meshgrid(xoverL,tau2); respdata=[]; for i=1:401 if fix(((i+1)/2))==(i+1)/2; respdata((i+1)/2,:)=Y(i,:); end end box on grid on mesh(X,T,respdata); if FF==2 ztextloc=1.8*ymax; else ztextloc=2*ymax; end view(143,30) text(.6, 20, ztextloc,'Distance, x/L','Rotation',14) text(1,2,1.1*ztextloc,xlabeltext,'Rotation',-25) %text(0,2,.9*low,'Press Enter to Continue','Rotation',-25) zlabel(ylabeltext) %pause end % --- Executes on button press in PRbutton. function PRbutton_Callback(hObject, eventdata, handles) % hObject handle to PRbutton (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) function AoString_Callback(hObject, eventdata, handles) % hObject handle to AoString (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of AoString as text % str2double(get(hObject,'String')) returns contents of AoString as a double % --- Executes during object creation, after setting all properties. function AoString_CreateFcn(hObject, eventdata, handles) % hObject handle to AoString (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function ALstring_Callback(hObject, eventdata, handles) % hObject handle to ALstring (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) AL = str2num(get(handles.ALstring,'string')); BC = get(handles.BClist,'value'); if(AL ==0)||(AL==1 && (BC==1||BC==3||BC==4)) set(handles.ALstring,'string','0.5'); errordlg('Point load location in error','Error'); end handles.output = hObject; guidata(hObject, handles); % Hints: get(hObject,'String') returns contents of ALstring as text % str2double(get(hObject,'String')) returns contents of ALstring as a double % --- Executes during object creation, after setting all properties. function ALstring_CreateFcn(hObject, eventdata, handles) % hObject handle to ALstring (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function [Y,ymax,tau1,fdioverf1]=response(phi,LT,FF,zeta1,fioverf1,aoverL1,q0,foverf1); % This function calculates the response data in array Y % numerically calculate spatial force expansion coefs fi fdioverf1=[]; zeta=[]; for i=1:5 zeta(1,i)= zeta1/fioverf1(1,i); fdioverf1(1,i)=fioverf1(1,i)*sqrt(1-zeta(1,i)^2); fdioverfd1(1,i)=fdioverf1(1,i)/sqrt(1-zeta(1,1)^2); end % calculate the fi coefficients of the expansion of f(x) if LT~=1 for i=1:5 if LT==2 f(1,i)=phi(i,aoverL1); elseif LT==3 f(1,i)=(sum(phi(i,:))-.5*phi(i,101))*.01; end end end Y=zeros(401,101); tindex=0; tau1=[]; if(LT==1)%initial displacement only for tau=0:.05:20%time loop tau1=[tau1 tau]; tindex=tindex+1; for i=1:5%series loop Term=q0(1,i)*exp(-zeta(1,i)*fioverf1(1,i)*tau); Term=Term*(cos(fdioverf1(1,i)*tau)+(zeta(1,i)/sqrt(1-zeta(1,i)^2))*sin(fdioverf1(1,i)*tau))*phi(i,:); Y(tindex,:)=Y(tindex,:)+Term; end end Ymax=max(max(abs(Y))); Y=Y/Ymax; end if (FF==1)&(LT~=1) %impulse in time forcing function, zero initial disp. and vel. for tau=0:.05:20 %time loop tau1=[tau1,tau]; tindex=tindex+1; for i=1:5 %series loop Term=f(1,i)*exp(-zeta(1,i)*fioverf1(1,i)*tau)*sin(fdioverf1(1,i)*tau)*phi(i,:)/fdioverfd1(1,i); Y(tindex,:)=Y(tindex,:)+Term; end end end if FF==2&(LT~=1)%step in time forcing function, zero initial disp. and vel. for tau=0:.05:20 %time loop tau1=[tau1,tau]; tindex=tindex+1; for i=1:5 %series loop Term1=(1-exp(-zeta(1,i)*fioverf1(1,i)*tau)*cos(fdioverf1(1,i)*tau)); Term2=Term1-(zeta(1,i)/(sqrt(1-zeta(1,i)^2)))*exp(-zeta(1,i)*fioverf1(1,i)*tau)*sin(fdioverf1(1,i)*tau); Term=Term2*f(1,i)*phi(i,:)/(fioverf1(1,i)^2); Y(tindex,:)=Y(tindex,:)+Term; end end end if FF==3&(LT~=1)%cosine in time forcing function, steady state response only for tau=0:.05:20 %time loop tau1=[tau1,tau]; tindex=tindex+1; sum1=zeros(1,101); for i=1:5 %series loop Gi=f(1,i)/((fioverf1(1,i)^2)-(foverf1^2)+j*2*zeta(1,i)*fioverf1(1,i)*foverf1); Term=phi(i,:)*abs(Gi)*cos(tau+angle(Gi)); sum1=sum1+Term; end Y(tindex,:)=sum1; end end ymax=max(max(abs(Y))); % end of response calculation function function NCstring_Callback(hObject, eventdata, handles) % hObject handle to NCstring (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of NCstring as text % str2double(get(hObject,'String')) returns contents of NCstring as a double Q = get(handles.NCstring,'string'); handles.QV = str2num(Q); %q1 = QV(1) %q2 = QV(2) %q3 = QV(3) %q4 = QV(4) %q5 = QV(5) handles.output = hObject; guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function NCstring_CreateFcn(hObject, eventdata, handles) % hObject handle to NCstring (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end