哈工大材料力学上机报告--绘制梁的剪力弯矩图(4)

红尘袭香 分享 2019-04-30 下载文档

ring'));

b2=str2double(get(handles.edit7,'String'));

M=str2double(get(handles.edit8,'String'));

c=str2double(get(handles.edit9,'String'));

setappdata(BianXing_ZuoGuDingDuan,'E',E);

setappdata(BianXing_ZuoGuDingDuan,'L',L);

setappdata(BianXing_ZuoGuDingDuan,'F',F);

setappdata(BianXing_ZuoGuDingDuan,'a',a);

setappdata(BianXing_ZuoGuDingDuan,'q',q);

setappdata(BianXing_ZuoGuDingDuan,'b1',b1);

setappdata(BianXing_ZuoGuDingDuan,'b2',b2);

setappdata(BianXing_ZuoGuDingDuan,'M',M);

setappdata(BianXing_ZuoGuDingDuan,'c',c);

% Hint: get(hObject,'Value') returns toggle state of togglebutton3

% --- Executes on button press in togglebutton5.

function

togglebutton5_Callback(hObject, eventdata, handles)

% hObject handle to togglebutton5 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

axes(handles.axes2); cla;

axes(handles.axes3); cla;

str1=num2str(0); str2=num2str(0); set(handles.edit10,'String',str1); set(handles.edit11,'String',str2); str3=num2str(0); str4=num2str(0);

set(handles.edit12,'String',str3); set(handles.edit13,'String',str4); 3.简支梁的源程序

E=10^9*str2double(get(handles.edit1,'String'));

L=str2double(get(handles.edit2,'String'));

F=str2double(get(handles.edit3,'String'));

a=str2double(get(handles.edit4,'String'));

q=str2double(get(handles.edit5,'String'));

b1=str2double(get(handles.edit6,'String'));

b2=str2double(get(handles.edit7,'String'));

M=str2double(get(handles.edit8,'String'));

c=str2double(get(handles.edit9,'String'));

x=[0:L/500:L]; FAy1=F-F*a/L; FBy1=F*a/L;

FBy2=q*(b2-b1)*(b2+b1)/(2*L); FAy2=q*(b2-b1)-FBy2; FAy3=M/L; FBy3=M/L; leng=length(x);

xx1=round(a/L*leng); xx21=round(b1/L*leng); xx22=round(b2/L*leng); xx3=round(c/L*leng); for ii=1:leng if ii<=xx1

Fsx1(ii)=-FAy1;

Mx1(ii)=FAy1*(ii-1)*L/500; else

Fsx1(ii)=FBy1;

Mx1(ii)=FBy1*(L-(ii-1)*L/500);

end end

for ff=1:leng if ff<=xx21

Fsx2(ff)=-FAy2;

Mx2(ff)=FAy2*(ff-1)*L/500;

else

if ff<=xx22

Fsx2(ff)=q*((ff-1)*L/500-b1)-FAy2;

Mx2(ff)=FAy2*(ff-1)*L/500-((ff-1)*L/500-b1)^2*q/2;

else

Fsx2(ff)=FBy2;

Mx2(ff)=FBy2*(L-(ff-1)*L/500);

end end end

for pp=1:leng if pp<=xx3

Fsx3(pp)=-FAy3;

Mx3(pp)=FAy3*(pp-1)*L/500;

else

Fsx3(pp)=-FBy3;

Mx3(pp)=-FBy3*(L-(pp-1)*L/500);

end end flag1=1; flag2=1;

Fsx=Fsx1+Fsx2+Fsx3; Mx=Mx1+Mx2+Mx3; for jj=1:leng

if abs(Fsx(jj))>=abs(Fsx(flag1)) flag1=jj; end

if abs(Mx(jj))>=abs(Mx(flag2)) flag2=jj; end end yy=0*ones(1,leng); yyy2=abs(Fsx); yyyy2=max(yyy2); yyy3=abs(Mx); yyyy3=max(yyy3); axes(handles.axes2); grid on

plot(x,yy,'LineWidth',2);

axis([0,L,-1.2*yyyy2,1.2*yyyy2]); hold on

plot(x,Fsx,'LineWidth',2); hold on

xxx1=L/500*(flag1-1);

plot(xxx1,Fsx(flag1),'bo','MarkerSize',10);

hold on

for kk=1:4:leng

plot([x(kk),x(kk)],[0,Fsx(kk)],'LineWidth',0.4)

end

xlabel('x/m');

ylabel('??á|Fs/N'); axes(handles.axes4); grid on

plot(x,yy,'LineWidth',2);

axis([0,L,-1.2*yyyy3,1.2*yyyy3]); hold on

plot(x,Mx,'LineWidth',2); hold on

xxx2=L/500*(flag2-1);

plot(xxx2,Mx(flag2),'bo','MarkerSize',10);

for ll=1:4:leng

plot([x(ll),x(ll)],[0,Mx(ll)],'LineWidth',0.4)

end

xlabel('x/m'); ylabel('í???M/N.m'); str1=num2str(yyyy2); str2=num2str(xxx1);

set(handles.edit10,'String',str1); set(handles.edit11,'String',str2);

str3=num2str(yyyy3); str4=num2str(xxx2);

set(handles.edit14,'String',str3); set(handles.edit15,'String',str4); 4.左外伸梁的源程序

E=10^9*str2double(get(handles.edit1,'String'));

L=str2double(get(handles.edit2,'String'));

F=str2double(get(handles.edit4,'String'));

a=-str2double(get(handles.edit5,'String'));

q=str2double(get(handles.edit6,'String'));

b1=-str2double(get(handles.edit7,'String'));

b2=-str2double(get(handles.edit8,'String'));

M=str2double(get(handles.edit9,'String'));

c=-str2double(get(handles.edit10,'String'));

d=-str2double(get(handles.edit3,'String'));

x=[0:-L/500:-L]; leng=length(x);

xx1=round(-a/L*leng); xx21=round(-b1/L*leng); xx22=round(-b2/L*leng); xx3=round(-c/L*leng); xx4=round(-d/L*leng); if -a<=-d

FBy1=F*a/d; FAy1=F-FBy1; for ii=1:leng if ii<=xx1

Fsx1(ii)=-FAy1;

Mx1(ii)=FAy1*(ii-1)*L/500;

else

if ii<=xx4

Fsx1(ii)=FBy1; Mx1(ii)=FBy1*(-d-(ii-1)*L/500);

else

Fsx1(ii)=0; Mx1(ii)=0; end end end else

FBy1=F*a/d; FAy1=FBy1-F; for ii=1:leng if ii<=xx4

Fsx1(ii)=FAy1;

Mx1(ii)=-FAy1*(ii-1)*L/500;

else

if ii<=xx1

Fsx1(ii)=-F; Mx1(ii)=-F*(-a-(ii-1)*L/500);

else

Fsx1(ii)=0; Mx1(ii)=0; end end end end

if -b2<=-d

FBy2=q*(b2-b1)*(b2+b1)/(2*(-d));

FAy2=-q*(b2-b1)-FBy2; for ff=1:leng if ff<=xx21

Fsx2(ff)=-FAy2

Mx2(ff)=FAy2*(ff-1)*L/500;

else

if ff<=xx22

Fsx2(ff)=-FAy2-q*((ff-1)*L/500+b1);

Mx2(ff)=FAy2*(ff-1)*L/500+q*((ff-1)*L/500+b1)*((ff-1)*L/500+b1)/2;

else

if ff<=xx4 else Fsx2(ff)=FBy2;

Mx2(ff)=FBy2*(-d-(ff-1)*L/500);

else

Fsx2(ff)=0; Mx2(ff)=0 end end end end else

if (-b1<=-d)&&(-b2>=-d)

FAy2=q*((d-b1)^2-(d-b2)^2)/(2*d);

FBy2=q*(b2-b1)-FAy2; for gg=1:leng if gg<=xx21

Fsx2(gg)=-FAy2;

Mx2(gg)=FAy2*(gg-1)*L/500;

else

if gg<=xx4

Fsx2(gg)=-FAy2-q*((gg-1)*L/500+b1);

Mx2(gg)=FAy2*(gg-1)*L/500+q*((gg-1)*L/500+b1)^2/2;

else

if gg<=xx22 Fsx2(gg)=q*(-b2-(gg-1)*L/500);

Mx2(gg)=q*(-b2-(gg-1)*L/500)^2/2;

else Fsx2(gg)=0;

Mx2(gg)=0;

end end end end

FBy2=q*(b2-b1)*(b2+b1)/(2*d);

FAy2=FBy2-q*(b2-b1); for pp=1:leng if pp<=xx4

Fsx2(pp)=FAy2;

Mx2(pp)=-FAy2*(pp-1)*L/500;

else

if pp<=xx21 Fsx2(pp)=-q*(b2-b1);

Mx2(pp)=FBy2*((pp-1)*L/500+d)-FAy2*(pp-1)*L/500;

else

if pp<=xx22 Fsx2(pp)=q*(-b2-(pp-1)*L/500);

Mx2(pp)=q*(-b2-(pp-1)*L/500)^2/2;

else Fsx2(pp)=0;

Mx2(pp)=0;

end end end end end end if -c<=-d

FAy3=M/(-d); FBy3=M/(-d); for jj=1:leng if jj<=xx3

Fsx3(jj)=-FAy3;

Mx3(jj)=FAy3*(jj-1)*L/500;

else

if jj<=xx4

Fsx3(jj)=-FAy3;

Mx3(jj)=FAy3*(jj-1)*L/500-M;

else

Fsx3(jj)=0; Mx3(jj)=0 end end end else

FAy3=M/(-d); FBy3=M/(-d); for jj=1:leng if jj<=xx4

Fsx3(jj)=-FAy3;

Mx3(jj)=FAy3*(jj-1)*L/500;

else

if jj<=xx3

Fsx3(jj)=0; Mx3(jj)=0; else

Fsx3(jj)=0; Mx3(jj)=0; end end end end flag1=1; flag2=1;

Fsx=Fsx1+Fsx2+Fsx3; Mx=Mx1+Mx2+Mx3; for jj=1:leng

if abs(Fsx(jj))>=abs(Fsx(flag1)) flag1=jj; end

if abs(Mx(jj))>=abs(Mx(flag2)) flag2=jj; end

end yy=0*ones(1,leng); yyy2=abs(Fsx); yyyy2=max(yyy2); yyy3=abs(Mx); yyyy3=max(yyy3); axes(handles.axes2); grid on

plot(x,yy,'LineWidth',2);

axis([-L,0,-1.2*yyyy2,1.2*yyyy2]); hold on

plot(x,Fsx,'LineWidth',2); hold on

xxx1=L/500*(flag1-1); mmm=-xxx1;

plot(mmm,Fsx(flag1),'bo','MarkerSize',10);

hold on

for kk=1:4:leng

plot([x(kk),x(kk)],[0,Fsx(kk)],'LineWidth',0.4)

end

xlabel('x/m');

ylabel('??á|Fs/N'); axes(handles.axes3); grid on

plot(x,yy,'LineWidth',2);

axis([-L,0,-1.2*yyyy3,1.2*yyyy3]); hold on

plot(x,Mx,'LineWidth',2); hold on

xxx2=L/500*(flag2-1); nnn=-xxx2;

plot(nnn,Mx(flag2),'bo','MarkerSize',10);

for ll=1:4:leng

plot([x(ll),x(ll)],[0,Mx(ll)],'LineWidth',0.4)

end

xlabel('x/m'); ylabel('í???M/N.m'); str1=num2str(yyyy2); str2=num2str(-xxx1);

set(handles.edit11,'String',str1); set(handles.edit12,'String',str2); str3=num2str(yyyy3); str4=num2str(-xxx2);

set(handles.edit13,'String',str3); set(handles.edit14,'String',str4);


哈工大材料力学上机报告--绘制梁的剪力弯矩图(4).doc 将本文的Word文档下载到电脑

下一篇:健康/医疗史问卷

相关推荐
相关阅读
本类排行
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 7 元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xxxxxx QQ:xxxxxx