Sie sind auf Seite 1von 12

function varargout = PORTICOS(varargin)

% PORTICOS M-file for PORTICOS.fig


%
PORTICOS, by itself, creates a new PORTICOS or raises the existing
%
singleton*.
%
%
H = PORTICOS returns the handle to a new PORTICOS or the handle to
%
the existing singleton*.
%
%
PORTICOS('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in PORTICOS.M with the given input
arguments.
%
%
PORTICOS('Property','Value',...) creates a new PORTICOS or raises
the
%
existing singleton*. Starting from the left, property value pairs
are
%
applied to the GUI before PORTICOS_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property
application
%
stop. All inputs are passed to PORTICOS_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 PORTICOS

% Last Modified by GUIDE v2.5 01-Aug-2015 04:01:37


% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @PORTICOS_OpeningFcn, ...
'gui_OutputFcn', @PORTICOS_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 PORTICOS is made visible.


function PORTICOS_OpeningFcn(hObject, eventdata, handles, varargin)
scrsz = get(0, 'ScreenSize');
pos_act=get(gcf,'Position');
xr=scrsz(3) - pos_act(3);
xp=round(xr/2);
yr=scrsz(4) - pos_act(4);
yp=round(yr/2);
set(gcf,'Position',[xp yp pos_act(3) pos_act(4)]);
img=imread('unsch.jpg');
axes(handles.axes1);
imshow(img);
axis off
img=imread('CIVIL.jpg');
axes(handles.axes2);
imshow(img);
axis off
img=imread('PORTICOO.jpg');
axes(handles.axes3);
imshow(img);
axis off

handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes PORTICOS wait for user response (see UIRESUME)
% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = PORTICOS_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;

function edit1_Callback(hObject, eventdata, handles)


global N
N=str2double(get(handles.edit1,'string'));
celda=cell(N,2);
celda(:,:)={''};
set(handles.lista1,'Data',celda);
set(handles.lista1,'ColumnEditable',true(1,2))
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)
global M
M=str2double(get(handles.edit2,'string'));
celda=cell(M,2);
celda(:,:)={''};
set(handles.lista3,'Data',celda);
set(handles.lista3,'ColumnEditable',true(1,2))
celda=cell(M,2);
celda(:,:)={''};
set(handles.lista4,'Data',celda);
set(handles.lista4,'ColumnEditable',true(1,2))
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)


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 on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
set(handles.resultado,'string','MATRIZ DE RIGIDEZ GLOBAL DEL SISTEMA');
global N M VI Elas Beta R CG ngl NMC nMCA
N=str2double(get(handles.edit1,'string'));
M=str2double(get(handles.edit2,'string'));
VI=str2double(get(handles.edit5,'string'));
Elas=str2double(get(handles.edit3,'string'));

Beta=str2double(get(handles.edit4,'string'));
R=str2double(get(handles.edit6,'string'));
NMC=str2double(get(handles.edit7,'string'));
nMCA=str2double(get(handles.edit8,'string'));
%REATRICCIONES
ngl=0;
CG=ones(N,3);
restricciones=str2double(get(handles.lista2,'data'));
for i=1:R
a=restricciones(i,1)
if restricciones(i,2)==0
CG(a,1)=0
else
CG(a,1)=1
end
if restricciones(i,3)==0
CG(a,2)=0
else
CG(a,2)=1
end
if restricciones(i,4)==0
CG(a,3)=0
else
CG(a,3)=1
end
end
%GRADOS DE LIBRTAD
for i=1:N
for j=1:3
if CG(i,j)~=0
ngl=ngl+1;
CG(i,j)=ngl
else
end
end
end
CG
ngl
%ARREGLOS VECTORIALES (NUDOS INICIAL Y FINAL)
% lectura del numero de miembros
mbr=str2double(get(handles.lista3,'data'));
ini=mbr(:,1);
fin=mbr(:,2);
%%%%%%%%%%%%%55P=NM(:,3);
%ARREGL VC VECTOR DE COLOCACION
for i=1:M
for k=1:3
VC(i,k)= CG(ini(i), k);
VC(i,k+3) = CG(fin(i),k);
end
end
VC
% lectura del nmero de nudos y coordenadas
XY=str2double(get(handles.lista1,'data'));
x=XY(:,1);
y=XY(:,2);
%ARREGLO L, SENO Y COSENO

for i=1:M
Dx(i) = x(fin(i)) - x(ini(i));
Dy(i) = y(fin(i)) - y(ini(i));
L(i) = ((Dx(i))^2 + (Dy(i))^2)^0.5;
SENO(i) = Dy(i)/L(i);
COSENO(i) = Dx(i)/L(i);
end
L
SENO
COSENO
%GENERACIN DE LA MATRIZ A
for i=1:M
for m = 1:N
for n = 1:3
if CG(m,n) ~= 0
ui(i)=0;uf(i)=0;
vi(i)=0;vf(i)=0;
gi(i)=0;gf(i)=0;
for p = 1:6
if VC(i,p)==CG(m,n)& p<=3 & n==1
ui(i)=COSENO(i);uf(i)=0;
vi(i)=-SENO(i);vf(i)=0;
gi(i)=0;gf(i)=0;
elseif VC(i,p)==CG(m,n)& p<=3 & n==2
%SINO
ui(i)=SENO(i);uf(i)=0;
vi(i)=COSENO(i);vf(i)=0;
gi(i)=0;gf(i)=0;
elseif VC(i,p)==CG(m,n)& p<=3 & n==3
ui(i)=0;uf(i)=0;
vi(i)=0;vf(i)=0;
gi(i)=1;gf(i)=0;
elseif VC(i,p)==CG(m,n)& p>3 & n==1
ui(i)=0;uf(i)=COSENO(i);
vi(i)=0;vf(i)=-SENO(i);
gi(i)=0;gf(i)=0;
elseif VC(i,p)==CG(m,n)& p>3 & n==2
ui(i)=0;uf(i)=SENO(i);
vi(i)=0;vf(i)=COSENO(i);
gi(i)=0;gf(i)=0;
elseif VC(i,p)==CG(m,n)& p>3 & n==3
ui(i)=0;uf(i)=0;
vi(i)=0;vf(i)=0;
gi(i)=0;gf(i)=1;
else,end
end
col=CG(m,n);
fil=(i-1)*3;
A(fil+1,col)=gi(i)-(vf(i)-vi(i))/L(i);
A(fil+2,col)=gf(i)-(vf(i)-vi(i))/L(i);
A(fil+3,col)=uf(i)-ui(i);
else,end
end
end
end
%MATRIZ DE COMPATIBILIDAD
A
%CLCULO DE LA MATRIZ DE RIGIDEZ DE LA ESTRUCTURA

G=0.4*Elas
K=zeros(ngl,ngl);
for i=1:M
%PROPIEDADES DEL MIEMBRO
BH=str2double(get(handles.lista4,'data'));
B=BH(:,1);
H=BH(:,2);
Area(i) = B(i)*H(i);
Inercia(i) = B(i)*H(i)^3/12;
fi = (3*Elas*Inercia(i)*Beta)/(G*Area(i)*L(i)^2);
EI4=((4*Elas*Inercia(i))/L(i))*((1+fi)/(1+4*fi));
EI2=((2*Elas*Inercia(i))/L(i))*((1-2*fi)/(1+4*fi));
EA=((Elas*Area(i))/L(i));
% MATRIZ DE RIGIDEZ DE MIEMBRO K2 EN COORD. LOCALES
K2(i,1,1)=EI4;K2(i,1,2)=EI2;K2(i,1,3)=0;
K2(i,2,1)=EI2;K2(i,2,2)=EI4;K2(i,2,3)=0;
K2(i,3,1)=0;K2(i,3,2)=0;K2(i,3,3)=EA;
% MATRIZ DE TRANSFORMACION
T2_3(i,1,1)=COSENO(i);T2_3(i,1,2)=SENO(i);T2_3(i,1,3)=0;T2_3(i,1,4)=0;T2_
3(i,1,5)=0;T2_3(i,1,6)=0;
T2_3(i,2,1)=SENO(i);T2_3(i,2,2)=COSENO(i);T2_3(i,2,3)=0;T2_3(i,2,4)=0;T2_3(i,2,5)=0;T
2_3(i,2,6)=0;
T2_3(i,3,1)=0;T2_3(i,3,2)=0;T2_3(i,3,3)=1;T2_3(i,3,4)=0;T2_3(i,3,5)=0;T2_
3(i,3,6)=0;
T2_3(i,4,1)=0;T2_3(i,4,2)=0;T2_3(i,4,3)=0;T2_3(i,4,4)=COSENO(i);T2_3(i,4,
5)=SENO(i);T2_3(i,4,6)=0;
T2_3(i,5,1)=0;T2_3(i,5,2)=0;T2_3(i,5,3)=0;T2_3(i,5,4)=SENO(i);T2_3(i,5,5)=COSENO(i);T2_3(i,5,6)=0;
T2_3(i,6,1)=0;T2_3(i,6,2)=0;T2_3(i,6,3)=0;T2_3(i,6,4)=0;T2_3(i,6,5)=0;T2_
3(i,6,6)=1;
% MATRIZ DE RIGIDEZ DEL MIEMBRO k EN COORD. LOCALES
for m=1:3
for n=1:3
K2I(m,n)=K2(i,m,n);
end
end
fprintf ('\n MATRIZ DE RIGIDEZ ELEMENTO EN COORD. LOCALES:');
k = K2I
fil =(i-1)*3;
Ap=A(fil+1:fil+3,1:ngl);
Kp=Ap'*k*Ap;
K=K+Kp;
end
K
set(handles.resulta,'data',K)
%uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
% ARREGLO DE LA MATRIZ Q
%CARGAS NODALES
Q=zeros(1,ngl);
NJC=str2double(get(handles.lista5,'data'));
VI=str2double(get(handles.edit5,'string'));

if VI~=0
for i=1:VI
NC=NJC(i,1);
Q1(1)=NJC(i,2);
Q1(2)=NJC(i,3);
Q1(3)=NJC(i,4);
VCJ(i,:)=CG(NC,:);
for m =1:3
n=VCJ(i,m);
if Q1(m)~=0
Q(n)=Q1(m) ;
else, end
end
Q_CJ=Q'
end
else
Q_CJ=Q'
end
% CARGAS EN LOS MIEMBROS
Q=zeros(1,ngl);
Q2_almac(M,6)=zeros;
nmc=str2double(get(handles.lista6,'data'));
NMC=str2double(get(handles.edit7,'string'));
if NMC~=0
for ll=1:NMC
Q2 = zeros(1,6);
MC=nmc(ll,1);
car=nmc(ll,2);
aa=nmc(ll,3);
Q2(1)=0 ; Q2(4)=0;
Q2(2)= car*L(MC)*(1-(aa/L(MC)))/2 ;
Q2(5)=Q2(2);
Q2(3)= car*(L(MC)^2)*(1-2*((aa/L(MC))^2)+((aa/L(MC))^3))/12;
Q2(6)=-Q2(3);
Q2=Q2'
for mm =1:6
Q2_almac(MC,mm)=Q2(mm)';
end
for m=1:6
for n=1:6
T2_3I(m,n)=T2_3(MC,m,n);
end
end
T2_3I;
Q3 = (-1)*T2_3I'*Q2
for g =1 :6
h = VC(MC,g);
if h ~=0
Q(h)= Q3(g)+Q(h);
else, end
end
Q_CM =Q'
end
else
Q_CM =Q'
end
%FUERZAS AXIALES

Q=zeros(1,ngl);
Q4_almac(M,6)=zeros;
nmcax=str2double(get(handles.lista7,'data'));
nMCA=str2double(get(handles.edit8,'string'));
if nMCA~=0
for nn=1:nMCA
Q4 = zeros(1,6);
MCA=nmcax(nn,1);
Q4(1)=nmcax(nn,2);
Q4(2)=nmcax(nn,3);
Q4(3)=nmcax(nn,4);
Q4(4)=nmcax(nn,5);
Q4(5)=nmcax(nn,6);
Q4(6)=nmcax(nn,7);
Q4=Q4'
for vv =1:6
Q4_almac(MCA,vv)=Q4(vv)';
end
for ww=1:6
for zz=1:6
T2_3II(ww,zz)=T2_3(MCA,ww,zz);
end
end
T2_3II;
Q5 = (-1)*T2_3II'*Q4
for gg =1 :6
hh = VC(MCA,gg);
if hh ~=0
Q(hh)= Q5(gg)+Q(hh);
else, end
end
Q_CMA =Q'
end
else
Q_CMA =Q'
end
% VECTOR DE CARGAS TOTALES
Q_TOTAL=Q_CJ+Q_CM+Q_CMA
% VECTOR DE DESPLAZAMIENTOS ( Q = K*q )
q_des = K\Q_TOTAL
% VECTOR DE DEFORMACIONES ( p = A*q )
p_def = A*q_des
%RESULTADOS
pes=[]
for i=1:M
fprintf( '\n >>>>> RESULTADO DEL MIEMBRO %d :',i);
% DEFORMACIONES p
fil = (i-1)*3;
p = p_def(fil+1:fil+3)
for m=1:3
for n=1:3
K2I(m,n)=K2(i,m,n);
end

end
CARGAS INTERNAS (P = k*p)
P= K2I*p
MMM=P(1);
Mp=P(2);
Ap=P(3);
P(1)= -Ap;
P(2)= (MMM+Mp)/L(i);
P(3)= MMM;
P(4)= Ap;
P(5)= -(MMM+Mp)/L(i);
P(6)= Mp;
% ACCIONES COORD. LOCALES (P. COMPLEMENTARIO)
P
% ACCIONES COORD. LOCALES (P. PRIMARIO)
for j=1:6
Q2_aux(j)=Q2_almac (i,j)+Q4_almac (i,j)
%UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
end
dd=Q2_aux'
% ACCIONES FINALES (PP+PC)
%PC_PP=zeros(6,M);
P_FINAL=dd+P
pes=[pes,P_FINAL]
end
%

function edit5_Callback(hObject, eventdata, handles)


global VI
VI=str2double(get(handles.edit5,'string'));
celda=cell(VI,4);
celda(:,:)={''};
set(handles.lista5,'Data',celda);
set(handles.lista5,'ColumnEditable',true(1,4))
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)


global R
R=str2double(get(handles.edit6,'string'));
celda=cell(R,4);
celda(:,:)={''};

set(handles.lista2,'Data',celda);
set(handles.lista2,'ColumnEditable',true(1,4))
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 edit7_Callback(hObject, eventdata, handles)


global NMC
NMC=str2double(get(handles.edit7,'string'));
celda=cell(NMC,3);
celda(:,:)={''};
set(handles.lista6,'Data',celda);
set(handles.lista6,'ColumnEditable',true(1,3))
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

% --- Executes on button press in Ayudar.


function Ayudar_Callback(hObject, eventdata, handles)
helpdlg('ESTA PARTE LO RESUELVE MIEMBROS CON CARGA DISTRIBUIDA,YA SEA
UNIFORMENTE RECTANGULAR (a(m)=0),TRINAGULAR SIMTRICO (a(m)=L/2) Y
TRAPEZOIDAL
(a(m)=YA SABES)','Curso_GUIDE');

function edit8_Callback(hObject, eventdata, handles)


global nMCA
nMCA=str2double(get(handles.edit8,'string'));
celda=cell(nMCA,7);
celda(:,:)={''};
set(handles.lista7,'Data',celda);
set(handles.lista7,'ColumnEditable',true(1,7))
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

% handles
called

empty - handles not created until after all CreateFcns

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


function aaayuda_Callback(hObject, eventdata, handles)
% hObject
handle to aaayuda (see GCBO)
% 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 pushbutton4.


function pushbutton4_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton4 (see GCBO)
% 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 pushbutton5.


function pushbutton5_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

Das könnte Ihnen auch gefallen