Sei sulla pagina 1di 16

UNIVERSIDAD NACIONAL SAN CRISTOBAL DE HUAMANGA ESCUELA DE FORMACION PROFESIONAL DE INGENIERIA CIVIL

CURSO: ANALISIS ESTRUCTURAL PROGRAMACIN: ANALISIS DE VIGAS EN MATLAB

ALUMNO: QUICHUA CABANA, Jess 16105056

AYACUCHO PERU-2013 SOLUCION DE VIGAS CON UN PROGRAMA CREADO EN MATLAB POR: Quichua Cabana Jess

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

EL PROGRAMA OBTIENE REACCIONES Y MOMENTOS EN CADA NUDO. A CONTINUACIN; ADJUNTO EL CDIGO FUENTE DEL PROGRAMA EN MATLAB
function varargout = VIGAS_CROSS_JESUS(varargin)

% VIGAS_CROSS_JESUS M-file for VIGAS_CROSS_JESUS.fig % VIGAS_CROSS_JESUS, by itself, creates a new VIGAS_CROSS_JESUS or 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', []); 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 VIGAS_CROSS_JESUS is made visible. function VIGAS_CROSS_JESUS_OpeningFcn(hObject, eventdata, handles, varargin) % Choose default command line output for VIGAS_CROSS_JESUS handles.output = hObject; % Update handles structure guidata(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);

% --- Outputs from this function are returned to the command line. function varargout = VIGAS_CROSS_JESUS_OutputFcn(hObject, eventdata, handles)

% Get default command line output from handles structure varargout{1} = handles.output;

% --- Executes on button press in pushbutton1. function edit1_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 edit1 as a double

% --- Executes during object creation, after setting all properties. function edit1_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 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) % --- 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

% --- Executes on button press in checkbox1. function checkbox1_Callback(hObject, eventdata, handles)

% --- Executes on button press in checkbox2. function checkbox2_Callback(hObject, eventdata, handles)

function edit3_Callback(hObject, eventdata, handles)

% --- 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

% --- Executes on button press in checkbox3. function checkbox3_Callback(hObject, eventdata, handles)

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

function edit5_Callback(hObject, eventdata, handles)

% --- 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)

% --- 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

% --- Executes on button press in pushbutton2. function pushbutton2_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)

function edit7_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. function edit7_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 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 edit8_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 edit8 as a double

% --- Executes during object creation, after setting all properties. function edit8_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 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 button press in pushbutton5. function pushbutton5_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')); if nt==1 La=[0;L]; K(1,1)=I(1,1)/L; else for i=1:nt if i==1 Li(i,1)=na(i,1); elseif i>1&i<nt Li(i,1)=na(i,1)-na(i-1,1); else Li(i,1)=L-na(i-1,1) ; end end

Li La(1,1)=0 for i=2:nt+1 La(i,1)=La(i-1,1)+Li(i-1,1); end La for i=1:nt K(i,1)=I(i,1)/Li(i,1) ; end K end if iii=='2' C(1,2)=0; elseif iii=='1' C(1,2)=1; end C(1,1)=0 for i=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 if fff=='2' C(nt+1,1)=0; elseif fff=='1' C(nt+1,1)=1; end C(nt+1,2)=0 MP=zeros(nt,2) La P for j=1:nf for i=2:nt+1 if La(i-1,1)<=P(j,1)& P(j,1)<La(i,1) a=P(j,1)-La(i-1,1) b=La(i,1)-P(j,1) ll=La(i,1)-La(i-1,1) MP(i-1,1)=-P(j,2)*a*b^2/(ll^2) MP(i-1,2)=P(j,2)*a^2*b/(ll^2) end end end MRe=zeros(nt,2) for j=1:nd for i=2:nt+1 if La(i-1,1)<=Re(j,1)& Re(j,2)<=La(i,1) c=(Re(j,2)-Re(j,1))/2 a=Re(j,1)-La(i-1,1)+c b=La(i,1)-Re(j,2)+c ll=La(i,1)-La(i-1,1) MRe(i-1,1)=-2*Re(j,3)*c*(a*b^2/(ll^2)-c^2*(3*b-ll)/(3*ll^2)) MRe(i-1,2)=2*Re(j,3)*c*(b*a^2/(ll^2)-c^2*(3*a-ll)/(3*ll^2)) end end end MM=zeros(nt,2) for j=1:nm for i=2:nt+1 if La(i-1,1)<=M(j,1)& M(j,1)<La(i,1)

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) end end end Mt=MP+MM+MRe C Mf(1,1)=0; for i=2:nt+1 for j=1:2 Mf(2*i+j-3,1)=Mt(i-1,j); end end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=size(Mf) A=zeros(q(1,1)-3,1); for i=2:q(1,1)-1 A(i-1,1)=sum(Mf(i,:)) ; end A set(handles.cross,'Data',Z); set(handles.resultado,'Data',A); La A for i=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); end Remr P Rep=zeros(2*nt,1); for j=1:nf for i=2:nt+1 if La(i-1,1)<=P(j,1)& P(j,1)<La(i,1) a=P(j,1)-La(i-1,1); b=La(i,1)-P(j,1); ll=La(i,1)-La(i-1,1); Rep(2*i-3,1)=P(j,2)*b/ll; Rep(2*i-2,1)=P(j,2)*a/ll; end end

end Rep Rem=zeros(2*nt,1); for j=1:nm for i=2:nt+1 if La(i-1,1)<=M(j,1)& M(j,1)<La(i,1) ll=La(i,1)-La(i-1,1); Rem(2*i-3,1)=-M(j,2)/ll; Rem(2*i-2,1)=M(j,2)/ll; end end end Rem Red=zeros(2*nt,1); for j=1:nd for i=2:nt+1 if La(i-1,1)<=Re(j,1)& Re(j,2)<=La(i,1) c=(Re(j,2)-Re(j,1))/2; a=Re(j,1)-La(i-1,1); b=La(i,1)-Re(j,2); ll=La(i,1)-La(i-1,1); Red(2*i-3,1)=2*Re(j,3)*c*(b+c)/ll; Red(2*i-2,1)=2*Re(j,3)*c*(a+c)/ll; end end end Red R=Remr+Rep+Rem+Red for i=1:nt+1 if i==1 Q(1,1)=R(i,1); elseif 1<i&i<nt+1 Q(i,1)=R(2*i-2,1)+R(2*i-1,1); else Q(nt+1,1)=R(2*nt,1); end end Q set(handles.reacciones,'Data',Q);

set(handles.a,'Visible','on'); set(handles.bb,'Visible','on'); xlswrite('PROCESO ITERATIVO DE HARDY CROSS.xlsx',Mf','Hoja1','B4') function iteraciones_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function iteraciones_CreateFcn(hObject, eventdata, handles) See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

% --- Executes on button press in pushbutton3.

function pushbutton3_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');

function luz_Callback(hObject, eventdata, handles)

% --- Executes during object creation, after setting all properties. function luz_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 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 apoyos_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function apoyos_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 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 button press in checkbox4. function checkbox4_Callback(hObject, eventdata, handles) nd=str2double(get(handles.ndistribuidos,'String')); u= cell(nd,3); u(:,:)={''};

set(handles.cargadistribuida,'data',u) set(handles.cargadistribuida,'Visible','on');

% --- Executes on button press in checkbox5. function checkbox5_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');

function edit11_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function edit11_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 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 button press in checkbox6. function checkbox6_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');

function ndistribuidos_Callback(hObject, eventdata, handles) function ndistribuidos_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 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 nmomentos_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function nmomentos_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 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 npuntual_Callback(hObject, eventdata, handles)

% --- Executes during object creation, after setting all properties. function npuntual_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 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 button press in pushbutton4. function pushbutton4_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'); function inicio_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties.

function inicio_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 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 final_Callback(hObject, eventdata, handles)

% --- Executes during object creation, after setting all properties. function final_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 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 presentacion_Callback(hObject, eventdata, handles) set(handles.a,'Visible','on'); set(handles.bb,'Visible','off'); % -------------------------------------------------------------------function vuelta_Callback(hObject, eventdata, handles) set(handles.a,'Visible','off'); set(handles.bb,'Visible','on'); % --- Executes during object deletion, before destroying properties. function pushbutton6_Callback(hObject, eventdata, handles)

helpdlg('QUICHUA CABANA, Jesus','Autora de:');

% --- Executes on button press in pushbutton7. function pushbutton7_Callback(hObject, eventdata, handles) helpdlg('QUICHUA CABANA, Jesus','Autora de:');

Potrebbero piacerti anche