Anda di halaman 1dari 9

INTERFAZ

CODIGO DEL GUIDE (Interfaz Grafica de Matlab)


function varargout = INTERFAZ(varargin)
% INTERFAZ MATLAB code for INTERFAZ.fig
%
INTERFAZ, by itself, creates a new INTERFAZ or raises the existing
%
singleton*.
%
%
H = INTERFAZ returns the handle to a new INTERFAZ or the handle to
%
the existing singleton*.
%
%
INTERFAZ('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in INTERFAZ.M with the given input arguments.
%
%
INTERFAZ('Property','Value',...) creates a new INTERFAZ or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before INTERFAZ_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to INTERFAZ_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 INTERFAZ
% Last Modified by GUIDE v2.5 07-May-2016 20:00:59
% Begin initialization code - DO NOT
gui_Singleton = 1;
gui_State = struct('gui_Name',
'gui_Singleton',
'gui_OpeningFcn',
'gui_OutputFcn',
'gui_LayoutFcn',
'gui_Callback',
if nargin && ischar(varargin{1})

EDIT
mfilename, ...
gui_Singleton, ...
@INTERFAZ_OpeningFcn, ...
@INTERFAZ_OutputFcn, ...
[] , ...
[]);

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 INTERFAZ is made visible.


function INTERFAZ_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 INTERFAZ (see VARARGIN)
% Choose default command line output for INTERFAZ
handles.output = hObject;
axes(handles.axes3)
im = imread ('apoyos.png')
imshow(im)
axes(handles.axes1)
im1 = imread ('structural-tee.png')
imshow(im1)
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes INTERFAZ wait for user response (see UIRESUME)
% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = INTERFAZ_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 popupmenu3.
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to popupmenu3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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 edit5_Callback(hObject, eventdata, handles)


% hObject
handle to edit5 (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 edit5 as text


%
str2double(get(hObject,'String')) returns contents of edit5 as a double

% --- Executes during object creation, after setting all properties.


function edit5_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit5 (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 edit6_Callback(hObject, eventdata, handles)


% hObject
handle to edit6 (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 edit6 as text
%
str2double(get(hObject,'String')) returns contents of edit6 as a double

% --- Executes during object creation, after setting all properties.


function edit6_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit6 (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 edit2_Callback(hObject, eventdata, handles)


% hObject
handle to edit2 (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 edit2 as text
%
str2double(get(hObject,'String')) returns contents of edit2 as a double

% --- Executes during object creation, after setting all properties.


function edit2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit2 (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 edit3_Callback(hObject, eventdata, handles)


% hObject
handle to edit3 (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 edit3 as text
%
str2double(get(hObject,'String')) returns contents of edit3 as a double

% --- Executes during object creation, after setting all properties.


function edit3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit3 (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 edit4_Callback(hObject, eventdata, handles)


% hObject
handle to edit4 (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 edit4 as text
%
str2double(get(hObject,'String')) returns contents of edit4 as a double

% --- Executes during object creation, after setting all properties.


function edit4_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit4 (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 when selected object is changed in APS.


function APS_SelectionChangedFcn(hObject, eventdata, handles)
% hObject
handle to the selected object in APS
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in vol.


function vol_Callback(hObject, eventdata, handles)
% hObject
handle to vol (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of vol

% --- Executes on button press in emp.


function emp_Callback(hObject, eventdata, handles)
% hObject
handle to emp (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
set(handles.fijo, 'value',0)
set(handles.art, 'value',0)
set(handles.vol, 'value',0)
opcion1 = get(handles.emp,'value')
if opcion1==1
k1=1
else
k1=0
% Hint: get(hObject,'Value') returns toggle state of emp
function fijo_Callback(hObject, eventdata, handles)
% hObject
handle to fijo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
set(handles.emp, 'value',0)
set(handles.art, 'value',0)
set(handles.vol, 'value',0)
opcion1 = get(handles.fijo,'value')
if opcion1==1
k1=1
else
k1=0
% Hint: get(hObject,'Value') returns toggle state of fijo

FUNCION PRINCIPAL

function [OcPn] = rescompres(fy,kx,ky,kz,L,Ag,Ix,Iy,bf,tf,d,tw,rx,ry,ro,Cw,J,H)


E = 200000 % Mpa
G = 77200 %Mpa
Oc = 0.9
Cw
sbs = elementosesbeltos(bf,tf,d,tw,E,fy)
if sbs==1

%no esbeltos

[Fcrx,Fcry]=flexionxy(kx,ky,L,rx,ry,E,fy)
Fcrt = flexiotorsion(ky,kz,E,fy,ry,H,G,J,Ag,Iy,ro,Cw,L)
if Fcrx < Fcry & Fcry < Fcrt
Fcr = Fcrx
Pn = Fcr*(Ag*25.4^2)
% N
OcPn = Oc*Pn
% N
elseif Fcrx < Fcrt & Fcrt < Fcry
Fcr= Fcrx
Pn = Fcr*(Ag*25.4^2)
OcPn = Oc*Pn
elseif Fcry < Fcrx & Fcrx < Fcrt
Fcr = Fcry
Pn = Fcr*(Ag*25.4^2)
OcPn = Oc*Pn
elseif Fcry < Fcrt & Fcrt < Fcrx

Fcr= Fcry
Pn = Fcr*(Ag*25.4^2)
OcPn = Oc*Pn
elseif Fcrt < Fcrx & Fcrx < Fcry
Fcr= Fcrt
Pn = Fcr*(Ag*25.4^2)
OcPn = Oc*Pn
elseif Fcrt < Fcry & Fcry < Fcrx
Fcr= Fcrt
Pn = Fcr*(Ag*25.4^2)
OcPn = Oc*Pn
end
else %esbeltos
Fcr=0
Pn = Fcr*(Ag*25.4^2)
OcPn = Oc*Pn
Fcrx=0
Fcry=0
Fcrt=0
end
Cw
Fcrx
Fcry
Fcrt
end

FUNCIONES SECUNDARIAS
function [sbs] = elementosesbeltos(bf,tf,d,tw,E,fy)

sblpatin = bf/(2*tf)
sblalma = d/tw
limsblpatin = (0.56*(E/fy)^(1/2))
limsblalma = (0.75*(E/fy)^(1/2))
if (sblpatin < limsblpatin) & (sblalma < limsblalma)
sbs = 1
else
sbs = 0
end
function [Fcrx,Fcry] = flexionxy(kx,ky,L,rx,ry,E,fy)
%pandeo por flexion eje x

F.2.5.3

RESx = ((kx*L)/rx)
limREX = 4.71*(E/fy)^(1/2)
RESy = ((ky*L)/ry)
limREy = 4.71*(E/fy)^(1/2)

if RESx <= limREX

%pandeo F.2.5.3-2

Fe = (pi^2)*E/((RESx)^2)
Fcrx= (0.658^(fy/Fe))*fy
else

Fe = (pi^2)*E/((RESx)^2)
Fcrx = 0.877*Fe
end
if RESy <= limREy

%pandeo y F.2.5.3-2

Fe = (pi^2)*E/((RESy)^2)
Fcry= (0.658^(fy/Fe))*fy
else
Fe = (pi^2)*E/((RESy)^2)
Fcry = 0.877*Fe
end

function [Fcrt] = flexiotorsion(ky,kz,E,fy,ry,H,G,J,A,Iy,ro,Cw,L)

% F.2.5.4-2

% torsion
pi = 3.141592654
if Cw==0
[Fcrx,Fcry]=flexionxy(1,ky,L,1,ry,E,fy)
Fcrz = ((G*J)/(A*ro^2)) %F.2.5.4-9
Fcrt = ((Fcry+Fcrz)/(2*H))*(1-(1-(4*Fcry*Fcrz*H)/(Fcry+Fcrz)^2)^(1/2))%F.2.5.4-5
else
RESy = ((ky*L)/ry)
Fey = (pi^2)*E/((RESy)^2)
Fez = ((((pi^2)*E*Cw)/(kz*L)^2)+ (G*J))*(1/(A*ro^2)) %F.2.5.4-9
Fe = ((Fey+Fez)/(2*H))*(1-(1-(4*Fey*Fez*H)/(Fey+Fez)^2)^(1/2))%F.2.5.4-5
Fcrt =(0.658^(fy/Fe))*fy
end
end

CODIGO MATLAB CON INTERFAZ GRAFICA


RESISTENCIA A LA COMPRESION SECCIONES EN T

GONZALO QUINTERO
COD: 100411012025

ING. HOMERO ERAZO

MAYO 2016
UNIVERSIDAD DEL CAUCA
POPAYAN CAUCA