informe matlab.doc

11
DEPARTAMENTO DE ENERGÍA Y MECÁNICA CARRERA DE INGENIERÍA AUTOMOTRIZ PROYECTO UNIDAD I ASIGNATURA: EDO CÓDIGO: 11005 NRC: 4195 NIVEL: III SEMANA CLASE: XIII DURACIÓN: 2 HORAS DEPARTAMENTO: CIENCIAS EXACTAS CARRERA: INGENIERÍA AUTOMOTRIZ ÁREA DEL CONOCIMIENTO: ECUACIONES DIFERENCIALES EN MATLAB TEMA: ECUACIONES DIFERENCIALES EN MATLAB DOCENTE: DRA. JACKELINE POZO ALUMNOS: MOLINA PAUL RECALDE GALO FECHA REALIZACIÓN: 27-MAYO-2015 FECHA DE ENTREGA: 29-MAYO-2015 EJE DE FORMACIÓN: PROFESIONAL A. FUNDAMENTACIÓN: APLICACIONES DE ECUACIONES DIFERNECIALES EN MATLAB Matlab es un entorno computacional que permite realizar cálculo simbólico y simulaciones numéricas, entre otras cosas. Por ejemplo, podemos resolver simbólica o numéricamente ecuaciones diferenciales. Un modelo simplificado del estudio del flujo atmosférico llevó a E. Lorenz a un sistema de tres ecuaciones diferenciales de primer orden. Es a partir de este ejemplo que Lorenz Acuñó llamó el efecto mariposa. La figura que observamos puede mirarse como las alas de una mariposa al volar. Aquí veremos la forma como se resuelven de modo simbólico ecuaciones diferenciales de primer o segundo orden que tengan una presentación simple. Así mismo, veremos la manera de graficar las soluciones halladas. En muchas ocasiones resolver una ecuación diferencial puede ser prácticamente imposible, en este caso nos queda el recurso de los métodos numéricos para aproximar soluciones de ecuaciones diferenciales. En esta situación haremos uso de una instrucción en Matlab: code45, que nos permitirá resolver numéricamente una ecuación diferencial de primer orden o sistemas de ecuaciones diferenciales de primer orden. Recordemos que una ecuación de primer orden tiene la forma Asociada a ella podemos tener una condición inicial

Upload: fernando-recalde

Post on 13-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

DEPARTAMENTO DE ENERGÍA Y MECÁNICACARRERA DE INGENIERÍA AUTOMOTRIZ

PROYECTO UNIDAD I

ASIGNATURA: EDO

CÓDIGO:11005

NRC:4195

NIVEL:III

SEMANA CLASE:XIII

DURACIÓN:2 HORAS

DEPARTAMENTO:CIENCIAS EXACTAS

CARRERA:INGENIERÍA

AUTOMOTRIZ

ÁREA DEL CONOCIMIENTO:

ECUACIONES DIFERENCIALES EN

MATLAB

TEMA:ECUACIONES

DIFERENCIALES EN MATLAB

DOCENTE:DRA. JACKELINE POZO

ALUMNOS:MOLINA PAUL

RECALDE GALO

FECHA REALIZACIÓN: 27-MAYO-2015

FECHA DE ENTREGA:29-MAYO-2015

EJE DE FORMACIÓN:PROFESIONAL

A. FUNDAMENTACIÓN:

APLICACIONES DE ECUACIONES DIFERNECIALES EN MATLAB

Matlab es un entorno computacional que permite realizar cálculo simbólico y simulaciones numéricas, entre otras cosas. Por ejemplo, podemos resolver simbólica o numéricamente ecuaciones diferenciales. Un modelo simplificado del estudio del flujo atmosférico llevó a E. Lorenz a un sistema de tres ecuaciones diferenciales de primer orden. Es a partir de este ejemplo que Lorenz Acuñó llamó el efecto mariposa.

La figura que observamos puede mirarse como las alas de una mariposa al volar. Aquí veremos la forma como se resuelven de modo simbólico ecuaciones diferenciales de primer o segundo orden que tengan una presentación simple. Así mismo, veremos la manera de graficar las soluciones halladas.

En muchas ocasiones resolver una ecuación diferencial puede ser prácticamente imposible, en este caso nos queda el recurso de los métodos numéricos para aproximar soluciones de ecuaciones diferenciales. En esta situación haremos uso de una instrucción en Matlab: code45, que nos permitirá resolver numéricamente una ecuación diferencial de primer orden o sistemas de ecuaciones diferenciales de primer orden.

Recordemos que una ecuación de primer orden tiene la forma

Asociada a ella podemos tener una condición inicial

Por ejemplo,

Con condición inicial

Un sistema no autónomo de ecuaciones diferenciales en el plano tiene la forma

Donde las funciones:

 Son funciones conocidas. Un ejemplo de un sistema de ecuaciones de primer orden en el plano está dado por:

MODELOS DE CRECIMIENTO DE POBLACIÓN

MODELO MALTHUSIANO

En este modelo de crecimiento poblacional se supone que la tasa de variación instantánea de una población es proporcional, en todo momento, a la población existente. Este tipo de modelo se usan para estudiar, por ejemplo, la forma como cambia la población de un cultivo de bacterias cuando estas se reproducen por división celular. Se supone asimismo que las bacterias tienen condiciones adecuadas para su reproducción. La temperatura es apropiada, tienen espacio vital y alimento suficiente.

Si denota la cantidad de bacterias que hay en el cultivo en el instante , se

tiene que la variación instantánea de esta, dada por , es proporcional a la población. Por lo que

Si la población inicial de bacterias es , usando el método de variables

separables, el lector puede mostrar que al tomar como condición inicial, entonces la solución particular está dada por la función

Es de notar que en este modelo no han sido tomados en cuenta muchos factores que pueden afectar el crecimiento de una población. Entre ellos podemos mencionar una tasa de mortandad por causas naturales, enfermedades, falta de alimento, sobrepoblación, entre otros.Una primera mejora en nuestro modelo, olvidando que en particular hemos considerado una población de bacterias. Es tomar en cuenta que además de una tasa de generación de nuevos individuos por unidad de tiempo, también hay una tasa de fallecimientos (por causas naturales) por unidad de tiempo.Si la tasa de nacimientos por unidad de tiempo es proporcional a la población, con constante de proporcionalidad y la tasa de muertes, en todo instante, también es proporcional a la cantidad de individuos, con constante de proporcionalidad , entonces el modelo poblacional está dado por

Un primer ejercicio consiste en mostrar que si entonces la población crecerá exponencialmente, mientras que en el caso , tendremos una extinción exponencial de la población.

B. DESCRIPCIÓN:

Éste Informe está formado por un ejercicio:

Aplicación de un diseño mediante el uso de una herramienta Matlab, con el consiguiente ahorro de tiempo y esfuerzo.

C. OBJETIVO:

Implementar los conocimientos adquiridos durante el periodo actual de Ecuaciones Diferenciales Ordinarias para observar la aplicación de la materia en la vida cotidiana mediante la realización de un programa en donde se observe la aplicación de las ecuaciones diferenciales en el software Matlab.

D. OBJETIVOS ESPECIFICOS:

Aplicar los conocimientos impartidos en clase en un problema de la vida cotidiana.

Investigar sobre el método de implementación de ecuaciones diferenciales dentro del software Matlab.

Realizar un programa en Matlab aplicando el uso de ecuaciones diferenciales.

E. TAREAS A REALIZAR:

Utilizar el programa Matlab para realizar un programa referente a las ecuaciones diferenciales.

F. IMPLEMENTACIÓN:

function varargout = crecimiento_poblacion(varargin)% CRECIMIENTO_POBLACION M-file for crecimiento_poblacion.fig% CRECIMIENTO_POBLACION, by itself, creates a new CRECIMIENTO_POBLACION or raises the existing% singleton*.%% H = CRECIMIENTO_POBLACION returns the handle to a new CRECIMIENTO_POBLACION or the handle to% the existing singleton*.%% CRECIMIENTO_POBLACION('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in CRECIMIENTO_POBLACION.M with the given input arguments.%% CRECIMIENTO_POBLACION('Property','Value',...) creates a new CRECIMIENTO_POBLACION or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before crecimiento_poblacion_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to crecimiento_poblacion_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 crecimiento_poblacion% Last Modified by GUIDE v2.5 27-May-2015 04:02:13% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @crecimiento_poblacion_OpeningFcn, ... 'gui_OutputFcn', @crecimiento_poblacion_OutputFcn, ... 'gui_LayoutFcn', [] , ...

'gui_Callback', []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif 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 crecimiento_poblacion is made visible.function crecimiento_poblacion_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 crecimiento_poblacion (see VARARGIN) % Choose default command line output for crecimiento_poblacionhandles.output = hObject; % Update handles structureguidata(hObject, handles);clcaxes(handles.axes1);grid onbox onaxes(handles.axes2);grid onbox on% UIWAIT makes crecimiento_poblacion wait for user response (see UIRESUME)% uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.function varargout = crecimiento_poblacion_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 structurevarargout{1} = handles.output; function ano1_Callback(hObject, eventdata, handles)% hObject handle to ano1 (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 ano1 as text% str2double(get(hObject,'String')) returns contents of ano1 as a double % --- Executes during object creation, after setting all properties.function ano1_CreateFcn(hObject, eventdata, handles)% hObject handle to ano1 (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 ano2_Callback(hObject, eventdata, handles)% hObject handle to ano2 (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 ano2 as text% str2double(get(hObject,'String')) returns contents of ano2 as a double % --- Executes during object creation, after setting all properties.function ano2_CreateFcn(hObject, eventdata, handles)% hObject handle to ano2 (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 p1_Callback(hObject, eventdata, handles)% hObject handle to p1 (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 p1 as text% str2double(get(hObject,'String')) returns contents of p1 as a double % --- Executes during object creation, after setting all properties.function p1_CreateFcn(hObject, eventdata, handles)% hObject handle to p1 (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 p2_Callback(hObject, eventdata, handles)% hObject handle to p2 (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 p2 as text% str2double(get(hObject,'String')) returns contents of p2 as a double % --- Executes during object creation, after setting all properties.function p2_CreateFcn(hObject, eventdata, handles)% hObject handle to p2 (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)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)A1 = str2num(get(handles.ano1, 'String'));A2 = str2num(get(handles.ano2, 'String'));A3 = str2num(get(handles.ano3, 'String')); P1 = str2num(get(handles.p1, 'String'));P2 = str2num(get(handles.p2, 'String')); % Tiempo transcurridoa = A2-A1; % Año 1A = P1; % Año 2B = P2;axes(handles.axes1);claaxes(handles.axes2);cla % Tiempo, desde esl año 1 hasta el año 3t1 = linspace(A1, A3, 16);K = log(B/A)/a;C = A; % Crecimiento para cada año trasncuridoP = C*exp(K*(t1-A1)); % Crecimiento total del ultimo añoP3 = C*exp(K*(A3-A1));set(handles.p3, 'String', P3);for i=1:length(t1) axes(handles.axes1);bar(t1(1:i), P(1:i));xlim([A1 A3])grid onxlim([A1 A3])ylim([0 P3])xlabel('\bfAÑO');ylabel('\bfPOBLACION');title('\bfCRECIMIENTO POBLACIONAL') axes(handles.axes2);plot(t1(1:i), P(1:i),'r', 'Linewidth', 4);xlim([A1 A3])grid onxlim([A1 A3])

ylim([0 P3])xlabel('\bfAÑO');ylabel('\bfPOBLACION');pause(0.2)end Texto = ['En el año ', num2str(A3), ', existirá un aproximado de ', num2str(round(P3)), ' Personas'];msgbox(Texto, 'Analisis de resultados', 'help') % --- 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)set(handles.ano1, 'String', '');set(handles.ano2, 'String', '');set(handles.ano3, 'String', ''); set(handles.p1, 'String', '');set(handles.p2, 'String', '');set(handles.p3, 'String', ''); axes(handles.axes1);clatitle('');xlabel('');ylabel('');axes(handles.axes1);clatitle('');xlabel('');ylabel(''); function ano3_Callback(hObject, eventdata, handles)% hObject handle to ano3 (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 ano3 as text% str2double(get(hObject,'String')) returns contents of ano3 as a double % --- Executes during object creation, after setting all properties.function ano3_CreateFcn(hObject, eventdata, handles)% hObject handle to ano3 (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 during object creation, after setting all properties.function p3_CreateFcn(hObject, eventdata, handles)% hObject handle to p3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called

% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(handles.ano1, 'String', '2010');set(handles.ano2, 'String', '2015');set(handles.ano3, 'String', '2017');set(handles.p1, 'String', '1024');set(handles.p2, 'String', '1753');

G. PRUEBAS:

H. RESULTADOS Y CONCLUSIONES:

Se pudo comprobar que las ecuaciones diferenciales se encuentran presentes en nuestro entorno con mucha frecuencia y en casi todas las cosas.

Matlab es un software que nos permite visualizar un problema aplicado con ecuaciones diferenciales de una manera sencilla.

Se realizó un programa aplicando una ecuación diferencial.

I. RECOMENDACIONES

Antes de comenzar con el proyecto elegir con cuidado el software que va a ser utilizado.

Aprender el uso correcto del software elegido ya que la aplicación de ecuaciones diferenciales requiere un proceso largo.

Buscar aplicaciones de las ecuaciones diferenciales en la vida cotidiana.

J. REFERENCIAS BIBLIOGRÁFICAS:

[online]:Nombre de autor (es):Tema:

[online]:Nombre de autor (es):Tema:

[online]:Nombre de autor (es):Tema:

[online]:Nombre de autor (es):Tema:

http://www.virtual.unal.edu.co/cursos/ingenieria/2001619/lecciones/descargas/senal.pdfBernardo A. DelicadoManual Matlab

http://www.educ.ar/sitios/educar/recursos/ver?id=14515Arturo RicaurteManual Matlab

https://ceromascero.wordpress.com/2013/09/05/2/comment-page-1/Ing Jorge SanchesGuillermo EndaraEcuaciones Diferenciales En Mathlab

https://www.youtube.com/watch?v=RxtA4iVY-34Jonnathan MendozaManejo de Imágenes Matlab