Está en la página 1de 15

Trabajo Parcial

Curso:

 Introducción a los métodos computacionales

Profesor:

 Saúl Luiz de Melo

Integrantes:

 Alexander Rodrigo Rios Garcia u201619966


 Andrés Antonio Marín Villavicencio u201610870
 Bryams Anthony Huayta Munive u201512303

Sección:

 CI61

Ciclo:

 2019-I
1. Antecedentes
La Cinemática es la rama de la mecánica clásica que estudia las leyes del movimiento de
los cuerpos sin tener en cuenta las causas que lo producen, limitándose, esencialmente,
al estudio de la trayectoria en función del tiempo. En la Cinemática se utiliza un sistema
de coordenadas para describir las trayectorias, denominado sistema de referencia.
Muchos filósofos, científicos y físicos observaron los movimientos de los cuerpos e
hicieron varias teorías, las cuales fueron estudiadas y comprobadas.
Hacia el 1604, Galileo Galilei hizo sus famosos estudios del movimiento de caída libre y
de esferas en planos inclinados a fin de comprender aspectos del movimiento relevantes
en su tiempo, como el movimiento de los planetas y de las balas de cañón.

2. Presentación del Problema


El movimiento rectilíneo
uniforme variado o acelerado
(MRUV) es cuando al movimiento
rectilíneo uniforme se le suma la
aceleración, es decir que la
aceleración del cuerpo en
movimiento ya deja de ser cero, el
ejemplo más común de este tipo
de movimiento es la caída libre de
un cuerpo, se mueve en línea
recta hacia el suelo y su velocidad
incrementa a medida que pasa el
tiempo(aceleración)
Para que un movimiento se pueda considerar que es un MRUV se deben dar las
siguientes condiciones, muchas de ellas son las mismas que aplican para el MRU
 Movimiento en línea recta.
 La aceleración en algún tramo del trayecto debe ser distinta de cero, de caso
contrario sería un MRU común.
 La aceleración, debe ser constante, es decir que las ecuaciones tienen valides
siempre y cuando la aceleración sea constante en el tramo de análisis.
La planeación del problema para nuestro proyecto es hallar la variable tiempo la cual
depende de las variables velocidad, aceleración y variación de la posición. Suponiendo
que el cuerpo parte desde una posición inicial (x0) hasta una posición final (xf) con una
aceleración constante (a) y una velocidad (v0), necesitamos hallar el tiempo transcurrido
para llegar a la posición final.
3. Objetivo
 Hallar el valor del tiempo definiendo que el cuerpo parte desde una posición
inicial (x0) hasta una posición final (xf) con una aceleración constante (a) y una
velocidad (v0)
 Determinar la gráfica en de posición vs el tiempo
 Determinar la gráfica de MRUV en función del tiempo

4. Desarrollo
Decidimos crear un programa para calcular el tiempo de la ecuación de MRUV por ello
realizamos los siguientes pasos:
Se escribió en la ventana de comandos GUIDE, damos en la opción predeterminada y
luego aceptamos.
Nos saldrá la siguiente ventana de la cual crearemos la interfaz para el resultado que
queremos hablar en este caso es el tiempo.

: Static text (nos ayuda a


colocar las etiquetas para saber que
variable es)

: Edit text (colocación de


valores alfanúmeros en forma de
texto, entrada y salida de datos)
Insertamos las variables en los
cuadros de texto estático

: Push button (botón que nos


ayuda a resolver las variables
dadas)

Creamos un panel de fondo, agregamos el título del trabajo incluida con su fórmula a
resolver. Ademas cada cuadro de texto editado colocamos un nombre apropiado para
su identificación en el tag tal como “cuadro_variable” para su fácil reconocimiento
Variables en el texto estatico

Colocación de datos

Valor a calcular

Push Button

Realizando click derecho sobre el botón calcular y eligiendo la opción callback, el


programa Matlab te requiere grabar el archivo, luego se presentará toda la hoja script
de guide donde se colocará los comandos para hacer funcionar el panel anterior
mostrado donde hallaremos el tiempo.
Realizamos el mismo proceso para las siguientes graficas modificando el botón en
callback y agregando los comandos necesarios. Nos quedaría nuestra interfaz completa
de la siguiente manera.

5. Conclusiones
 Logramos determinar el tiempo según las variables dadas en los cuadros
 Se logró determinar la gráfica de posición vs tiempo para cada valor dado
 Logramos hallar el comportamiento esperado de la gráfica a partir del eje
positivo
6. Anexos
function varargout = IMC_PARCIAL(varargin)
% IMC_PARCIAL MATLAB code for IMC_PARCIAL.fig
% IMC_PARCIAL, by itself, creates a new IMC_PARCIAL or raises the
existing
% singleton*.
%
% H = IMC_PARCIAL returns the handle to a new IMC_PARCIAL or the
handle to
% the existing singleton*.
%
% IMC_PARCIAL('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in IMC_PARCIAL.M with the given input
arguments.
%
% IMC_PARCIAL('Property','Value',...) creates a new IMC_PARCIAL
or raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before IMC_PARCIAL_OpeningFcn gets called.
An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to IMC_PARCIAL_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 IMC_PARCIAL

% Last Modified by GUIDE v2.5 05-May-2019 17:38:41

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @IMC_PARCIAL_OpeningFcn, ...
'gui_OutputFcn', @IMC_PARCIAL_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 IMC_PARCIAL is made visible.


function IMC_PARCIAL_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 IMC_PARCIAL (see VARARGIN)

% Choose default command line output for IMC_PARCIAL


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes IMC_PARCIAL wait for user response (see UIRESUME)


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = IMC_PARCIAL_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 cuadro_Xo_Callback(hObject, eventdata, handles)


% hObject handle to cuadro_Xo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global D
D=str2double(get(hObject,'string'))
% Hints: get(hObject,'String') returns contents of cuadro_Xo as text
% str2double(get(hObject,'String')) returns contents of
cuadro_Xo as a double

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


function cuadro_Xo_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_Xo (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 cuadro_Xf_Callback(hObject, eventdata, handles)


% hObject handle to cuadro_Xf (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global E
E=str2double(get(hObject,'string'))
% Hints: get(hObject,'String') returns contents of cuadro_Xf as text
% str2double(get(hObject,'String')) returns contents of
cuadro_Xf as a double

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


function cuadro_Xf_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_Xf (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 cuadro_tX_Callback(hObject, eventdata, handles)


% hObject handle to cuadro_tX (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global C
C=str2double(get(hObject,'string'))
% Hints: get(hObject,'String') returns contents of cuadro_tX as text
% str2double(get(hObject,'String')) returns contents of
cuadro_tX as a double

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


function cuadro_tX_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_tX (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 cuadro_Vo_Callback(hObject, eventdata, handles)


% hObject handle to cuadro_Vo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Vo
Vo=str2double(get(hObject,'string'))

% Hints: get(hObject,'String') returns contents of cuadro_Vo as text


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

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


function cuadro_Vo_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_Vo (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 cuadro_A_Callback(hObject, eventdata, handles)
% hObject handle to Texx (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A
A=str2double(get(hObject,'string'))
% Hints: get(hObject,'String') returns contents of Texx as text
% str2double(get(hObject,'String')) returns contents of Texx as
a double

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


function Texx_CreateFcn(hObject, eventdata, handles)
% hObject handle to Texx (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 cuadro_E_Callback(hObject, eventdata, handles)


% hObject handle to cuadro_E (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global F
F=str2double(get(hObject,'string'))
% Hints: get(hObject,'String') returns contents of cuadro_E as text
% str2double(get(hObject,'String')) returns contents of
cuadro_E as a double

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


function cuadro_E_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_E (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 GRAFICA.


function GRAFICA_Callback(hObject, eventdata, handles)
% hObject handle to GRAFICA (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Vo
global A
global C

T=-50:0.1:100;
y=Vo.*T+(0.5*A.*(T.^2))-C;
y1=0*T;
axes(handles.grafico1)
plot(T,y)
hold on
plot (T,y1)

hold off

% --- Executes on button press in GRAFICA_C.


function GRAFICA_C_Callback(hObject, eventdata, handles)
% hObject handle to GRAFICA_C (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A
global v
global p
global w
if A==0
set(handles.escribir,'string','gráfica lineal')
v=imread('lineal.jpg');
axes(handles.comportamiento);
imshow(v)
axis off
else
if A<0
set(handles.escribir,'string','gráfica negativa')
p=imread('negativo.jpg');
axes(handles.comportamiento);
imshow(p)
axis off
else
set(handles.escribir,'string','gráfica positiva')
w=imread('positivo.jpg');
axes(handles.comportamiento);
imshow(w)
axis off
end
end

% --- Executes on button press in LIMPIAR.


function LIMPIAR_Callback(hObject, eventdata, handles)
% hObject handle to LIMPIAR (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.cuadro_Xo,'string','')
set(handles.cuadro_Xf,'string','')
set(handles.cuadro_tX,'string','')
set(handles.cuadro_Vo,'string','')
set(handles.cuadro_A,'string','')
set(handles.cuadro_E,'string','')
set(handles.cuadro_tiempo,'string','')
set(handles.cuadro_caso,'string','')
set(handles.escribir,'string','')
set(handles.cuadro_rf,'string','')

function cuadro_Tiempo_Callback(hObject, eventdata, handles)


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

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


function cuadro_Tiempo_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_Tiempo (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 calcular_TT.


function calcular_TT_Callback(hObject, eventdata, handles)
% hObject handle to calcular_TT (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Vo %velocidad
global A %aceleracion
global C %variacion de x
global D %
global E %
global F %error
global G
f=inline('Vo*T+(0.5*A*(T^2))-C','Vo','A','C','T')
f(Vo,A,C,D)
f(Vo,A,C,E)
if f(Vo,A,C,D)*f(Vo,A,C,E)>0
set(handles.cuadro_caso,'string','el tiempo no se encuentra en el
dominio')
else

a=[]
b=[]
c=[]
d=[]
e=[]
q=[]

for i=1:100
f(Vo,A,C,D)
f(Vo,A,C,E)
Tr=(E+D)/2
f(Vo,A,C,Tr)
if f(Vo,A,C,D)*f(Vo,A,C,Tr)==0
set(handles.tiempo,'string',Tr)
break
else
if f(Vo,A,C,D)*f(Vo,A,C,Tr)<0
D=Tr
else
E=Tr
end
end
set(handles.cuadro_tiempo,'string',Tr)
if abs(f(Vo,A,C,Tr))<=F
break
end

a=[a D]
b=[b E]
c=[c f(Vo,A,C,D)]
d=[d f(Vo,A,C,E)]
e=[e Tr]
q=[q f(Vo,A,C,Tr)]

end
table(:,1)=a
table(:,2)=b
table(:,3)=c
table(:,4)=d
table(:,5)=e
table(:,6)=q

set(handles.cuadro_tabla,'data',table)

end

function cuadro_caso_Callback(hObject, eventdata, handles)


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


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

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


function cuadro_caso_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_caso (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 escribir_Callback(hObject, eventdata, handles)


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


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

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


function escribir_CreateFcn(hObject, eventdata, handles)
% hObject handle to escribir (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 cuadro_tiempo_Callback(hObject, eventdata, handles)


% hObject handle to cuadro_tiempo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global G
G=str2double(get(hObject,'string'))
% Hints: get(hObject,'String') returns contents of cuadro_tiempo as
text
% str2double(get(hObject,'String')) returns contents of
cuadro_tiempo as a double

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


function cuadro_tiempo_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_tiempo (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 cuadro_rf_Callback(hObject, eventdata, handles)
% hObject handle to cuadro_rf (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 cuadro_rf as text


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

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


function cuadro_rf_CreateFcn(hObject, eventdata, handles)
% hObject handle to cuadro_rf (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 RESULTADO.


function RESULTADO_Callback(hObject, eventdata, handles)
% hObject handle to RESULTADO (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
t=get(handles.cuadro_tiempo,'String');
t=str2num(t);
a=get(handles.cuadro_A,'String');
a=str2num(a);
v=get(handles.cuadro_Vo,'String');
v=str2num(v);
x=get(handles.cuadro_tX,'String');
x=str2num(x)

%%f(t)=v*tn+(a*tn^2)/2;
n=0;
t0=4;
tn=t0;
ft=v*tn+(a*tn^2)/2-x;
dft=v+a*tn;
for n=1:10
ft0=v*t0+(a*t0^2)/2-x;
dft0=v+a*t0;
t=t0-ft0/dft0;
t0=t;
end
set(handles.cuadro_rf,'String',t);

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


function logo_CreateFcn(hObject, eventdata, handles)
% hObject handle to logo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
I=imread('logo_upc1.jpg')
imshow(I)
% Hint: place code in OpeningFcn to populate logo

%INTEGRANTES
% ANDRES ANTONIO MARIN VILLAVIECNCIO
% ALEXANDER RIOS GARCIA
% BRIAMS HUAYTA MUNIVE

7. Bibliografia
 Cristian Veloso (2016). “Movimiento Rectilineo Uniforme Variado”. Extraido de:
https://www.electrontools.com/Home/WP/2016/09/30/movimiento-rectilineo-
uniforme-variado-mruv/
 Victoriano (2011). “CINEMATICA (MRU- MRUV)”. Extraido de: http://mate-
tucto.blogspot.com/2011/01/cinematica-mru-mruv.html
 FISICALAB (2014). “Ecuaciones Movimiento Rectilineo Uniforme Acelerado (M.R.U.A.)”.
Extraido de: https://www.fisicalab.com/apartado/mrua-ecuaciones#contenidos

También podría gustarte