UNIVERSIDAD NACIONAL SAN CRISTOBAL DE
HUAMANGA
FACULTAD DE INGENIERIA DE MINAS, GEOLOGIA Y CIVIL
ESCUELA DE INGENIERIA CIVIL
“Ejercicios Resueltos en Matlab”
CURSO: Resistencia de materiales II
DOCENTE: Ing. Huacre Vila, Jean
ALUMNO: Guerreros Quispe, Esaú
AYACUCHO-PERU
2018
Ejercicio numero 1:
Solución:
Calculo de Reacciones:
𝑅1 = 𝑅2 = 𝑑 ∗ 𝑞/2
Ecuaciones de Momento Flector y Fuerzas Cortantes:
0≤𝑥≤𝑑
𝑥2 𝑥
𝑀(𝑥 ) = 𝑞 ∗ − 𝑞 ∗ 𝑑 ∗
2 2
𝑞∗𝑑
𝑉 (𝑥 ) = 𝑞 ∗ 𝑥 −
2
Desarrollo en Matlab:
1. Interfaz Gráfica:
Pantalla principal:
Pantallas secundarias:
Codificación:
%CODIGO PARA INSERTAR IMAGENES AL GUIDE
axes(handles.axes1)
[Link]=imread('[Link]'); %Logo de la escuela
imagesc([Link])
axis off
axes(handles.axes2)
[Link]=imread('[Link]'); %Logo de la UNSCH
imagesc([Link])
axis off
axes(handles.axes3)
[Link]=imread('[Link]'); %Imagen del Problema
imagesc([Link])
axis off
%Algoritmo para limpiar los Axes
cla(handles.axes4,'reset')
cla(handles.axes5,'reset')
cla(handles.axes6,'reset')
%Algoritmo para la codificacion de datos introducidos en la interfas
Grafica
q=str2double(get(handles.q,'string'))
d=str2double(get(handles.d,'string'))
%CALCULOS
%--Distancia
Long=d;
%--Calculo de Reacciones
R1=d*q/2;
R2=d*q/2;
%Exportacion de datos calculados al Interfaz Grafica
set(handles.d1,'string',Long)
set(handles.q1,'string',q)
set(handles.R1,'string',R1)
set(handles.R2,'string',R2)
%Creacion de para el ploteo
%--FUNCION FUERZA NORMAL
N='0*x';
syms x
x=0:0.01:d;
y=eval(N);
axes(handles.axes4)
plot(x,y);
grid on
hold on
plot(x,zeros(size(x)),'r');
%--FUNCION CORTANTE
syms x
x=[0:0.1:d];
V=q*x-q*d/2;
axes(handles.axes5)
plot(x,V,'b','LineWidth',1.5);
line([x;x],[zeros(1,length(x));V],'color','b');
V=abs(V);
Z=max(max(V));
ylim([-Z-50,Z+50]);
grid on
hold on
plot(x,zeros(size(x)),'r');,
%--FUNCION MOMENTO FLECTOR
x=[0:0.1:d];
M=q*x.^2/2-q*d*x/2;
axes(handles.axes6)
plot(x,-M,'b','LineWidth',1.5);
line([x;x],[zeros(1,length(x));-M],'color','b');
M=abs(M);
Z=max(max(M));
ylim([-Z-50,Z+50]);
grid on
hold on
plot(x,zeros(size(x)),'r');
Resultados en el Matlab:
Ejercicio número 2:
Solución:
Calculo de Reacciones:
𝑃∗𝑏
𝑅1 =
𝑎+𝑏
𝑃∗𝑎
𝑅2 =
𝑎+𝑏
Ecuaciones de Momento Flector y Fuerzas Cortantes:
0≤𝑥<𝑎
𝑃∗𝑏
𝑀(𝑥 ) = ∗𝑥
𝑎+𝑏
𝑃∗𝑏
𝑉 (𝑥 ) =
𝑎+𝑏
𝑎 ≤ 𝑥 ≤ (𝑎 + 𝑏)
𝑃∗𝑏
𝑀(𝑥 ) = ∗ 𝑥 − 𝑃 ∗ (𝑥 − 𝑎)
𝑎+𝑏
𝑃∗𝑎
𝑉 (𝑥 ) = −
𝑎+𝑏
DESARROLLO EN MATLAB:
2. Interfaz Gráfica:
Pantalla principal:
Pantallas secundarias:
Codificación:
%CODIGO PARA INSERTAR IMAGENES AL GUIDE
guidata(hObject, handles);
axes(handles.axes1)
[Link]=imread('[Link]'); %Logo de la escuela
imagesc([Link])
axis off
axes(handles.axes2)
[Link]=imread('[Link]'); %Logo de la UNSCH
imagesc([Link])
axis off
axes(handles.axes3)
[Link]=imread('[Link]'); %Imagen del Problema
imagesc([Link])
axis off
%Algoritmo para limpiar los Axes
cla(handles.axes4,'reset')
cla(handles.axes5,'reset')
cla(handles.axes6,'reset')
%Algoritmo para la codificacion de datos introducidos en la interfas
Grafica
P=str2double(get(handles.P,'string'))
a=str2double(get(handles.a,'string'))
b=str2double(get(handles.b,'string'))
%CALCULOS
%--Calculo de Reacciones
R1=P*b/(a+b);
R2=P*a/(a+b);
%--Distancia
Long=a+b;
%Exportacion de datos calculados al Interfaz Grafica
set(handles.d,'string',Long)
set(handles.a1,'string',a)
set(handles.b1,'string',b)
set(handles.P1,'string',P)
set(handles.R1,'string',R1)
set(handles.R2,'string',R2)
%GRAAFICOS
%FUNCION FUERZA NORMAL
N='0*m';
syms m
m=0:0.01:Long;
y=eval(N);
axes(handles.axes4)
plot(m,y);
grid on
hold on
plot(m,zeros(size(m)),'r');
%FUNCIONES INICIALES
Long=double(Long)
x=[0:0.5:Long]
R=length(x)
for i=1:R
if x(i)>=0 && x(i)<a
V(i)=P*b/(a+b);
M(i)=P*b/(a+b)*x(i);
elseif x(i)>=a && x(i)<=Long
V(i)=-P*a/(a+b);
M(i)=P*b/(a+b)*x(i)-P*(x(i)-a);
end
end
V=double(V)
M=double(M)
%FUNCION GRAFICO CORTANTE
axes(handles.axes5)
plot(x,V,'color','b','LineWidth',1.5);
grid on
hold on
line([x;x],[zeros(1,length(x));V],'color','b');
plot(x,zeros(size(x)),'r');
V=abs(V);
Z=max(max(V));
ylim([-Z-20,Z+20]);
%FUNCION GRAFICO MOMENTO FLECTOR
axes(handles.axes6)
plot(x,-M,'color','b','LineWidth',1.5);
line([0 x(end)],[0 0],'color','k');
line([x;x],[zeros(1,length(x));-M],'color','b');
M=abs(M);
Z=max(max(M));
ylim([-Z-50,Z+50]);
grid on
hold on
plot(x,zeros(size(x)),'r');
Resultados en el Matlab: