7/27/2019 Manual de Uso Viga Cross Jesus
1/16
UNIVERSIDAD NACIONAL SAN CRISTOBAL DEHUAMANGA
ESCUELA DE FORMACION PROFESIONAL DEINGENIERIA CIVIL
CURSO: ANALISIS ESTRUCTURAL
PROGRAMACIN: ANALISIS DE VIGAS
EN MATLAB
ALUMNO: QUICHUA CABANA, Jess 16105056
AYACUCHO
PERU-2013
SOLUCION DE VIGAS CON UN PROGRAMACREADO EN MATLAB POR: Quichua Cabana Jess
7/27/2019 Manual de Uso Viga Cross Jesus
2/16
MANUAL DE USO:
1. ABRIR EL PROGRAMA:
SE PUEDE ABRIR DESDE EL PROGRAMA .exe DE MODO QUE NO REQUIERA
ABRIR EL MATLAB, MAS SOLAMENTE SE NECESITA TENER INSTALADO EL
RUNTIME DE MATLAB. EL PROGRAMA CORRER POR MEDIO DEL
COMPILADOR.
2. INGRESO DE DATOS
3. COMPLETE LOS DATOS
4. SOLUCION DE LA VIGA HIPERESTTICA
7/27/2019 Manual de Uso Viga Cross Jesus
3/16
EL PROGRAMA OBTIENE REACCIONES Y MOMENTOS EN CADA NUDO.
A CONTINUACIN; ADJUNTO EL CDIGO FUENTE DEL PROGRAMA EN MATLAB
functionvarargout = VIGAS_CROSS_JESUS(varargin)
7/27/2019 Manual de Uso Viga Cross Jesus
4/16
% VIGAS_CROSS_JESUS M-file for VIGAS_CROSS_JESUS.fig% VIGAS_CROSS_JESUS, by itself, creates a new VIGAS_CROSS_JESUSor raises the existing
gui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @VIGAS_CROSS_JESUS_OpeningFcn,...
'gui_OutputFcn', @VIGAS_CROSS_JESUS_OutputFcn, ...'gui_LayoutFcn', [] , ...'gui_Callback', []);
ifnargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
end
ifnargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT
% --- Executes just before VIGAS_CROSS_JESUS is made visible.functionVIGAS_CROSS_JESUS_OpeningFcn(hObject, eventdata, handles,varargin)
% Choose default command line output for VIGAS_CROSS_JESUShandles.output = hObject;
% Update handles structureguidata(hObject, handles);
% UIWAIT makes VIGAS_CROSS_JESUS wait for user response (see UIRESUME)% uiwait(handles.figure1);
imagen=imread('arti.jpg');axes(handles.uno);axis off;imshow(imagen);imagen=imread('empotrado.jpg');
axes(handles.dos);axis off;imshow(imagen);imagen=imread('distribuido.jpg');axes(handles.dist);axis off;imshow(imagen);imagen=imread('puntual.jpg');axes(handles.punt);axis off;imshow(imagen);imagen=imread('momento.jpg');axes(handles.mome);
axis off;imshow(imagen);
7/27/2019 Manual de Uso Viga Cross Jesus
5/16
% --- Outputs from this function are returned to the command line.functionvarargout = VIGAS_CROSS_JESUS_OutputFcn(hObject, eventdata,handles)
% Get default command line output from handles structurevarargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
functionedit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (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 edit1 as text% str2double(get(hObject,'String')) returns contents of edit1as a double
% --- Executes during object creation, after setting all properties.functionedit1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
functionedit2_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionedit2_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 CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
% --- Executes on button press in checkbox1.functioncheckbox1_Callback(hObject, eventdata, handles)
7/27/2019 Manual de Uso Viga Cross Jesus
6/16
% --- Executes on button press in checkbox2.functioncheckbox2_Callback(hObject, eventdata, handles)
functionedit3_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionedit3_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 CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
% --- Executes on button press in checkbox3.functioncheckbox3_Callback(hObject, eventdata, handles)
functionedit4_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionedit4_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 CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
functionedit5_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionedit5_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 CreateFcnscalled
7/27/2019 Manual de Uso Viga Cross Jesus
7/16
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');
end
functionedit6_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionedit6_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.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
% --- Executes on button press in pushbutton2.functionpushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
functionedit7_Callback(hObject, eventdata, handles)% hObject handle to edit7 (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 edit7 as text% str2double(get(hObject,'String')) returns contents of edit7
as a double
% --- Executes during object creation, after setting all properties.functionedit7_CreateFcn(hObject, eventdata, handles)% hObject handle to edit7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');
7/27/2019 Manual de Uso Viga Cross Jesus
8/16
end
functionedit8_Callback(hObject, eventdata, handles)% hObject handle to edit8 (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 edit8 as text% str2double(get(hObject,'String')) returns contents of edit8as a double
% --- Executes during object creation, after setting all properties.functionedit8_CreateFcn(hObject, eventdata, handles)% hObject handle to edit8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
% --- Executes on button press in pushbutton5.functionpushbutton5_Callback(hObject, eventdata, handles)
L=str2double(get(handles.luz, 'String'));nt=str2double(get(handles.apoyos, 'String'))+1;iii=(get(handles.inicio,'String'));fff=(get(handles.final,'String'));nf=str2double(get(handles.npuntual, 'String'))nm=str2double(get(handles.nmomentos, 'String'));nd=str2double(get(handles.ndistribuidos, 'String'));na=str2double(get(handles.xapoyos, 'data'))I=str2double(get(handles.inercia, 'data'))P=str2double(get(handles.cargapuntual, 'data'))Re=str2double(get(handles.cargadistribuida, 'data'))M=str2double(get(handles.cargamomentos, 'data'))it=str2double(get(handles.iteraciones, 'String'));
ifnt==1La=[0;L];K(1,1)=I(1,1)/L;
elsefori=1:nt
ifi==1Li(i,1)=na(i,1);
elseifi>1&i
7/27/2019 Manual de Uso Viga Cross Jesus
9/16
LiLa(1,1)=0
fori=2:nt+1La(i,1)=La(i-1,1)+Li(i-1,1);
end
Lafori=1:ntK(i,1)=I(i,1)/Li(i,1) ;
endKend
ifiii=='2'C(1,2)=0;
elseifiii=='1'C(1,2)=1;
endC(1,1)=0
fori=1:nt-1
C(i+1,1)=K(i,1)/(K(i,1)+K(i+1,1))C(i+1,2)=K(i+1,1)/(K(i,1)+K(i+1,1))end
iffff=='2'C(nt+1,1)=0;
elseiffff=='1'C(nt+1,1)=1;
endC(nt+1,2)=0
MP=zeros(nt,2)LaPforj=1:nf
fori=2:nt+1if La(i-1,1)
7/27/2019 Manual de Uso Viga Cross Jesus
10/16
a=M(j,1)-La(i-1,1)b=La(i,1)-M(j,1)ll=La(i,1)-La(i-1,1)
MM(i-1,1)=M(j,2)*b*(2*a-b)/(ll^2)MM(i-1,2)=M(j,2)*(2*b-a)*a/(ll^2)
endendend
Mt=MP+MM+MReCMf(1,1)=0;fori=2:nt+1
forj=1:2Mf(2*i+j-3,1)=Mt(i-1,j);
endendMf(2*nt+2,1)=0;
fori=1:nt+1forj=1:2
Cf(2*i+j-2,1)=C(i,j);end
end
Mf(1,3)=-(Mf(1,1)+Mf(2,1))*Cf(1,1);Mf(2,3)=-(Mf(1,1)+Mf(2,1))*Cf(2,1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.resultado,'Data',A);
LaA
fori=1:nt
Remr(2*i-1,1)=-(A(2*i-1,1)+A(2*i,1))/(La(i+1,1)-La(i,1)); Remr(2*i,1)=-Remr(2*i-1,1);
endRemrPRep=zeros(2*nt,1);forj=1:nf
fori=2:nt+1if La(i-1,1)
7/27/2019 Manual de Uso Viga Cross Jesus
12/16
endRepRem=zeros(2*nt,1);forj=1:nmfori=2:nt+1
if La(i-1,1)
7/27/2019 Manual de Uso Viga Cross Jesus
13/16
functionpushbutton3_Callback(hObject, eventdata, handles)
nr=str2double(get(handles.apoyos, 'String'));
u= cell(nr,1);u(:,:)={''};
set(handles.xapoyos,'data',u)set(handles.xapoyos,'Visible','on');
functionluz_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionluz_CreateFcn(hObject, eventdata, handles)% hObject handle to luz (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
functionapoyos_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionapoyos_CreateFcn(hObject, eventdata, handles)% hObject handle to apoyos (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.
ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
% --- Executes on button press in checkbox4.functioncheckbox4_Callback(hObject, eventdata, handles)
nd=str2double(get(handles.ndistribuidos, 'String'));
u= cell(nd,3);u(:,:)={''};
7/27/2019 Manual de Uso Viga Cross Jesus
14/16
set(handles.cargadistribuida, 'data',u)set(handles.cargadistribuida, 'Visible','on');
% --- Executes on button press in checkbox5.functioncheckbox5_Callback(hObject, eventdata, handles)
nm=str2double(get(handles.nmomentos, 'String'));
r= cell(nm,2);r(:,:)={''};set(handles.cargamomentos,'data',r)set(handles.cargamomentos,'Visible','on');
functionedit11_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionedit11_CreateFcn(hObject, eventdata, handles)% hObject handle to edit11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
% --- Executes on button press in checkbox6.functioncheckbox6_Callback(hObject, eventdata, handles)
nf=str2double(get(handles.npuntual, 'String'));
u= cell(nf,2);u(:,:)={''};
set(handles.cargapuntual,'data',u)set(handles.cargapuntual,'Visible','on');
functionndistribuidos_Callback(hObject, eventdata, handles)
functionndistribuidos_CreateFcn(hObject, eventdata, handles)% hObject handle to ndistribuidos (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
7/27/2019 Manual de Uso Viga Cross Jesus
15/16
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');
end
functionnmomentos_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionnmomentos_CreateFcn(hObject, eventdata, handles)% hObject handle to nmomentos (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
functionnpuntual_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionnpuntual_CreateFcn(hObject, eventdata, handles)% hObject handle to npuntual (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton4.functionpushbutton4_Callback(hObject, eventdata, handles)
nr=str2double(get(handles.apoyos, 'String'));u= cell(nr+1,1);u(:,:)={''};set(handles.inercia,'data',u)set(handles.inercia,'Visible','on');
functioninicio_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
7/27/2019 Manual de Uso Viga Cross Jesus
16/16
functioninicio_CreateFcn(hObject, eventdata, handles)% hObject handle to inicio (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
functionfinal_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.functionfinal_CreateFcn(hObject, eventdata, handles)% hObject handle to final (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.ifispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor' ))
set(hObject,'BackgroundColor','white');end
% --------------------------------------------------------------------functionpresentacion_Callback(hObject, eventdata, handles)set(handles.a,'Visible','on');set(handles.bb,'Visible','off');
% --------------------------------------------------------------------functionvuelta_Callback(hObject, eventdata, handles)set(handles.a,'Visible','off');set(handles.bb,'Visible','on');
% --- Executes during object deletion, before destroying properties.
functionpushbutton6_Callback(hObject, eventdata, handles)
helpdlg('QUICHUA CABANA, Jesus','Autora de:');
% --- Executes on button press in pushbutton7.functionpushbutton7_Callback(hObject, eventdata, handles)
helpdlg('QUICHUA CABANA, Jesus','Autora de:');