Sei sulla pagina 1di 3

% --- Executes on button press in calcular.

function calcular_Callback(hObject, eventdata, handles)


% hObject handle to calcular (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%clear all
%clc
% Emplearemos el modelo de Hognestad del concreto y el modelo
% elastoplástico del acero
%fpc = input('Ingrese fpc del concreto en kg/cm2: ');
%fy = input(' Ingrese fy del acero en kg/cm2: ');
%ey = input('Ingrese ey: ');%0.0021
%esh= input('Ingrese esh: ');%0.08
%eo = input('Ingrese eo: '); %0.002
%ecu = input('Ingrese ecu: ');%0.0033
%b=input('Ingrese la base de la viga: ');
%h=input('Ingrese la altura de la viga: ');
%r=input('Ingrese recubrimiento inferior: ');
%dp=input('Ingrese recubrimiento superior: ');
%As=input('Ingrese área del acero inferior: ');
%Asp=input('Ingrese área del acero superior: ');

% Entrada de valores
fpc=str2double(get(handles.fpc,'String'));
fy=str2double(get(handles.fy,'string'));
ey=str2double(get(handles.ey,'string'));%0.0021
esh=str2double(get(handles.esh,'string'));%0.08
eo=str2double(get(handles.eo,'string'));%0.002
ecu=str2double(get(handles.ecu,'string'));%0.0033
b=str2double(get(handles.b,'string'));
h=str2double(get(handles.h,'string'));
r=str2double(get(handles.r,'string'));
dp=str2double(get(handles.dp,'String'));
As=str2double(get(handles.As,'string'));
Asp=str2double(get(handles.Asp,'string'));

% Salida de valores
set(handles.Mn,'string',Mn);
set(handles.cc,'string',cc);
set(handles.rc,'string',rc);

Es= fy/ey;
d=h-r;
c=h/2;

disp('Para acero en fluencia "est=ey"');

dfr=100;
for i=1:h*100/2
c=h/2-(i-1)/100;
ec= c*ey/(d-c);
esp=(c-dp)*ec/c;
co=c*eo/ec;
A=fpc*(c^2)*(3*co-c)/(3*co^2);
ys=(8*c*co-3*c^2)/(12*co-4*c);
if esp<ey
Cs=esp*Es*Asp;
else
Cs=fy*Asp;
end
Cc=A*b;
Ts=fy*As;
dfr1=Ts-Cc-Cs;
if abs(dfr)>abs(dfr1)
dfr=dfr1;
Cc1=Cc;
Cs1=Cs;
Ts1=Ts;
ys1=ys;
c1=c;
rcy=ec*100/c1;
end
end
Mny=Cc1*ys1+Cs1*(c1-dp)+Ts1*(d-c1);
c1;
rcy;
% Salida de valores
set(handles.Mny,'string',Mny);
set(handles.c1,'string',c1);
set(handles.rcy,'string',rcy);
%Para el concreto en fpc=fcmáx y ec=eo');

dfr=100;
for i=1:round(c1*100)
co=c1-(i-1)/100;
esp=(co-dp)*eo/co;
A=2*fpc*co/3;
ys=5*co/8;
if esp<ey
Cs=esp*Es*Asp;
else
Cs=fy*Asp;
end
Cc=A*b;
Ts=fy*As;
dfr1=Ts-Cc-Cs;
if abs(dfr)>abs(dfr1)
dfr=dfr1;
Cc1=Cc;
Cs1=Cs;
Ts1=Ts;
ys1=ys;
c2=co;
rco=eo*100/c2;
end
end
Mno=Cc1*ys1+Cs1*(c2-dp)+Ts1*(d-c2);
c2;
rco;
% Salida de valores
set(handles.Mno,'string',Mno);
set(handles.c2,'string',c2);
set(handles.rco,'string',rco);

disp('Para resistencia última del concreto y ec=ecu');


dfr=100;
for i=1:round(c2*100)
cu=c2-(i-1)/100;
co=eo*cu/ecu;
esp= (cu-dp)*ecu/cu;
A=2*fpc*co/3+37*fpc*(cu-co)/40;
ys=(co-3*cu)*(7*co+18*cu)/(31*co-111*cu);
if esp<ey
Cs=esp*Es*Asp;
else
Cs=fy*Asp;
end
Cc=A*b;
Ts=fy*As;
dfr1=Ts-Cc-Cs;
if abs(dfr)>abs(dfr1)
dfr=dfr1;
Cc1=Cc;
Cs1=Cs;
Ts1=Ts;
ys1=ys;
c3=cu;
rcu=ecu*100/c3;
end
end
Mnu=Cc1*ys1+Cs1*(c3-dp)+Ts1*(d-c3;
c3;
rcu;
% Salida de valores
set(handles.Mnu,'string',Mnu);
set(handles.c3,'string',c3);
set(handles.rcu,'string',rcu);

Potrebbero piacerti anche