PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

7
MÉTODOS MATEMÁTICOS Y NUMÉRICOS PARA INGENIERÍA 1 FECHA: MAYO 2011 SOLUCIÓN NUMÉRICA PÉNDULO ELÁSTICO OSCILANTE CON RUNGE KUTTA 4 EN MATLAB Ccarita Cruz Fredy Alan, Hugo Reymundo Alvarez Profesor: Mgt. Roy Sánchez Gutiérrez Pontificia Universidad Católica del Perú, Maestría en Ingeniería Mecánica, Métodos Matemáticos y Numéricos para Ingeniería Lima: 27.05.2011 RESUMEN En este estudio sobre péndulo elástico muelle-masa que se investiga. Con el fin de resolver un sistema de ecuaciones diferenciales no lineales que se obtienen de la aplicación de la segunda ley de newton que representan el fenómeno físico y que no es posible determinar la solución por los métodos analíticos, considerando solucionarlo y demostrar que si es posible con los métodos numéricos y en este caso utilizaremos el método numérico de Runge Kutta 4 para sistemas con ayuda del software Matlab, se hará la demostración para dos variaciones de longitud del péndulo y ver que eventos se producen por estas variaciones, los resultados se compararan con otros trabajos para verificar los mismo, al final quedamos conforme con el trabajo porque lo dicho anteriormente ha podido ser demostrado. Palabras claves: péndulo elástico, la oscilación no lineal, la técnica de simulación, Matlab, Runge - Kutta ABSTRACT In this study of elastic spring-mass pendulum is investigated. In order to solve a system of nonlinear differential equations obtained from the application of Newton's second law to represent the physical phenomenon and it is not possible to determine the solution by analytical methods, considering solutions and demonstrate that it is possible with numerical methods and in this case we use the numerical method of Runge Kutta 4 for systems using the Matlab software, will show for two variations of length of the pendulum and see what events are produced by these variations, the results were compared with other papers for the same in the end we were satisfied with the work because of the above has been demonstrated . Keywords: elastic pendulum, nonlinear oscillation, the technique of simulation, Matlab, Runge – Kutta 4 1. INTRODUCION La aplicación de las ecuaciones diferenciales dentro de la ingeniería Mecanica para determinar las ecuaciones que gobiernan los fenómenos físicos de estudio son muchísimas por no decir infinitas, pero la gran mayoría de estas no tienen solución numérica es por esa razón que se ha hecho necesario solucionar de

description

SOLUCION NUMERICA DE UN PENDULO ELASTICO DE UNA GRADO DE LIBERTAD APLICANDO LA TEORIA DE RUNGE KUTTA 4 EN MATLAB

Transcript of PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

Page 1: PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

MÉTODOS MATEMÁTICOS Y NUMÉRICOS PARA INGENIERÍA 1FECHA: MAYO 2011

SOLUCIÓN NUMÉRICA PÉNDULO ELÁSTICO OSCILANTE CON RUNGE KUTTA 4 ENMATLAB

Ccarita Cruz Fredy Alan, Hugo Reymundo AlvarezProfesor: Mgt. Roy Sánchez Gutiérrez

Pontificia Universidad Católica del Perú, Maestría en Ingeniería Mecánica, MétodosMatemáticos y Numéricos para Ingeniería

Lima: 27.05.2011

RESUMEN

En este estudio sobre péndulo elástico muelle-masa que se investiga. Con el fin deresolver un sistema de ecuaciones diferenciales no lineales que se obtienen de laaplicación de la segunda ley de newton que representan el fenómeno físico y que no esposible determinar la solución por los métodos analíticos, considerando solucionarlo ydemostrar que si es posible con los métodos numéricos y en este caso utilizaremos elmétodo numérico de Runge Kutta 4 para sistemas con ayuda del software Matlab, se harála demostración para dos variaciones de longitud del péndulo y ver que eventos seproducen por estas variaciones, los resultados se compararan con otros trabajos paraverificar los mismo, al final quedamos conforme con el trabajo porque lo dichoanteriormente ha podido ser demostrado.

Palabras claves: péndulo elástico, la oscilación no lineal, la técnica de simulación,Matlab, Runge - Kutta

ABSTRACT

In this study of elastic spring-mass pendulum is investigated. In order to solve a system ofnonlinear differential equations obtained from the application of Newton's second law torepresent the physical phenomenon and it is not possible to determine the solution byanalytical methods, considering solutions and demonstrate that it is possible withnumerical methods and in this case we use the numerical method of Runge Kutta 4 forsystems using the Matlab software, will show for two variations of length of the pendulumand see what events are produced by these variations, the results were compared withother papers for the same in the end we were satisfied with the work because of the abovehas been demonstrated.Keywords: elastic pendulum, nonlinear oscillation, the technique of simulation, Matlab,Runge – Kutta 4

1. INTRODUCION

La aplicación de las ecuacionesdiferenciales dentro de la ingenieríaMecanica para determinar las ecuaciones

que gobiernan los fenómenos físicos deestudio son muchísimas por no decirinfinitas, pero la gran mayoría de estas notienen solución numérica es por esa razónque se ha hecho necesario solucionar de

Page 2: PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

MÉTODOS MATEMÁTICOS Y NUMÉRICOS PARA INGENIERÍA 2FECHA: MAYO 2011

alguna manera estas ecuacionesdiferenciales, razón por la cual hoy en díahay muchos métodos como el Método deElementos Finitos (FEM), DiferenciasFinitas (FDM), Método de VariaciónIteracional (VIM), Método de PerturbaciónHomotropica (HPM) etc etc, para nuestrocaso utilizaremos el método de RungeKutta 4 en Matlab.

2. ECUACIONES QUE GOBIERNAN ELSISTEMA

Aplicando la segunda ley de Newton ytrabajando en coordenadas cilíndricas(r,θ) tendríamos lo siguiente:

Ahora podemos escribir

Σ : − sin = (1): = 2 + (2)

− sinθ = m 2 + − = 2 + = − − 2 = − − 2 (3)

Σ : cos − = (4): = − ( − ) (5)= − (6)− [− ( − )] =+ ( − ) = − − ( − ) = − = + − ( − )

Figura 1 . Diagrama de cuerpo libre péndulo elástico en el punto 2

Page 3: PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

MÉTODOS MATEMÁTICOS Y NUMÉRICOS PARA INGENIERÍA 3FECHA: MAYO 2011

= + − ( − ) (7)De donde:

L : Longitud sin deformar.r : Radio. : Velocidad radial. : Asceleración radial.

: Posición angular. : Velocidad Angular. : Asceleración Angular.k : Constante de Rigidezm : Masa.g : gravedad.t : tiempo.

El sistema es conservador porque no hayamortiguación. Por lo tanto la energíatotal (energía cinética y energía potencial)del sistema es siempre constante y eltiempo invariante (holonómica).Con el fin de investigar loscomportamientos de la elástica delpéndulo, algunos parámetros se debendar. Por esta razón, la frecuencia naturaldel resorte y el péndulo respectivamente,como sigue:

= = 12.64; = = 19.61Por otra parte determinaremos unaconstante:

= = = 0.353. SOLUCIÓN NUMÉRICA

Para la solución numérica con RungeKutta 4 para sistemas, debemos de utilizarlas ecuaciones (3) y (7), pero antesdebemos de trasformar estas ecuacionesa un sistema de ecuaciones diferenciales:

Creación de la matriz μ

= ′ = ′ = + ( ) − ( − )−2 − ( )

Para la solución de este problemadebemos de dar los siguientes datos:

g=9.80665 m/s2; k=40N/m; L=0.5m,m=0.25Kg

Tendremos lo siguiente:

= + 9.80665 ( ) − 160 + 80−2 − 9.80665 ( )Con las siguientes condiciones iniciales:

= 0.5030 = Una vez reemplazado las variables ahoradebemos de utilizar el método de RungeKutta 4 para sistemas:

RUNGE-KUTTA 4 PARA SISTEMAS"POR FILAS" DE ECUACIONES

DIFERENCIALES

Function A=rks4M(F,a,b,Za,M)%Datos: F es la función vectorial, el

intervalo [a b]%Za=[x1(a)...xn(a)] es la condición inicial yM es el número de pasos.

Page 4: PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

MÉTODOS MATEMÁTICOS Y NUMÉRICOS PARA INGENIERÍA 4FECHA: MAYO 2011

%Resultados: T, vector de los nodos,Z=[x1(t)... xn(t)],las aproximaciones

h=(b-a)/M;T=zeros(1,M+1);Z=zeros(M+1,length(Za));T=a:h:b;Z(1,:)=Za;for j=1:M

k1=h*feval(F,T(j),Z(j,:));k2=h*feval(F,T(j)+h/2,Z(j,:)+k1/2);k3=h*feval(F,T(j)+h/2,Z(j,:)+k2/2);k4=h*feval(F,T(j)+h,Z(j,:)+k3);Z(j+1,:)=Z(j,:)+(k1+2*k2+2*k3+k4)/6;

endA=[T' Z];End

Antes de ello debemos de definir losiguiente F,a,b,Za,M

F

function Z=Fs5(t,Z)a=Z(1);b=Z(2);c=Z(3);d=Z(4);Z=[b a*d.^2+9.80665*cos(c)-160*a+80 d -2*b*d./a-9.80665*sin(c)./a];

a=0 ; b=0.5 ; Za=

0.5030 ; M=100

Por lo tanto tendríamos:

A=rks4M('Fs5',0,0.5,[0.5 0 pi/3 0],100)

Que resulta:

A =t r 0 0.5000 0 1.0472 0

0.0050 0.5001 0.0245 1.0470 -0.08490.0100 0.5002 0.0490 1.0463 -0.16970.0150 0.5006 0.0734 1.0453 -0.25420.0200 0.5010 0.0976 1.0438 -0.33840.0250 0.5015 0.1217 1.0419 -0.42210.0300 0.5022 0.1455 1.0396 -0.5051

0.0350 0.5030 0.1691 1.0369 -0.58750.0400 0.5039 0.1924 1.0337 -0.66900.0450 0.5049 0.2153 1.0302 -0.74950.0500 0.5060 0.2378 1.0262 -0.82910.0550 0.5073 0.2599 1.0219 -0.90750.0600 0.5086 0.2815 1.0171 -0.98470.0650 0.5101 0.3026 1.0120 -1.06050.0700 0.5117 0.3231 1.0065 -1.13510.0750 0.5133 0.3429 1.0007 -1.20810.0800 0.5151 0.3621 0.9945 -1.27970.0850 0.5169 0.3807 0.9879 -1.34980.0900 0.5189 0.3984 0.9810 -1.41820.0950 0.5209 0.4154 0.9737 -1.48500.1000 0.5230 0.4315 0.9661 -1.55020.1050 0.5252 0.4468 0.9582 -1.61370.1100 0.5275 0.4612 0.9500 -1.67550.1150 0.5299 0.4746 0.9415 -1.73560.1200 0.5323 0.4871 0.9326 -1.79400.1250 0.5347 0.4986 0.9235 -1.85080.1300 0.5372 0.5090 0.9141 -1.90580.1350 0.5398 0.5184 0.9045 -1.95920.1400 0.5424 0.5266 0.8945 -2.01100.1450 0.5451 0.5338 0.8844 -2.06120.1500 0.5478 0.5398 0.8739 -2.10980.1550 0.5505 0.5447 0.8633 -2.15690.1600 0.5532 0.5484 0.8524 -2.20250.1650 0.5560 0.5509 0.8412 -2.24670.1700 0.5587 0.5523 0.8299 -2.28950.1750 0.5615 0.5525 0.8183 -2.33100.1800 0.5642 0.5515 0.8066 -2.37120.1850 0.5670 0.5493 0.7946 -2.41010.1900 0.5697 0.5459 0.7825 -2.44790.1950 0.5724 0.5414 0.7702 -2.48460.2000 0.5751 0.5358 0.7576 -2.52020.2050 0.5778 0.5290 0.7450 -2.55480.2100 0.5804 0.5211 0.7321 -2.58850.2150 0.5830 0.5121 0.7191 -2.62130.2200 0.5855 0.5021 0.7059 -2.65330.2250 0.5880 0.4911 0.6925 -2.68450.2300 0.5905 0.4791 0.6790 -2.71490.2350 0.5928 0.4662 0.6654 -2.74470.2400 0.5951 0.4525 0.6516 -2.77390.2450 0.5973 0.4378 0.6377 -2.80250.2500 0.5995 0.4224 0.6236 -2.83060.2550 0.6016 0.4063 0.6094 -2.85820.2600 0.6036 0.3895 0.5950 -2.88530.2650 0.6055 0.3721 0.5805 -2.91200.2700 0.6073 0.3541 0.5659 -2.93830.2750 0.6090 0.3357 0.5511 -2.96430.2800 0.6106 0.3168 0.5362 -2.99000.2850 0.6122 0.2976 0.5212 -3.01530.2900 0.6136 0.2781 0.5061 -3.04040.2950 0.6149 0.2583 0.4908 -3.06530.3000 0.6162 0.2385 0.4754 -3.0899

Page 5: PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

MÉTODOS MATEMÁTICOS Y NUMÉRICOS PARA INGENIERÍA 5FECHA: MAYO 2011

0.3050 0.6173 0.2185 0.4599 -3.11420.3100 0.6184 0.1985 0.4443 -3.13830.3150 0.6193 0.1786 0.4285 -3.16220.3200 0.6202 0.1587 0.4127 -3.18590.3250 0.6209 0.1391 0.3967 -3.20930.3300 0.6216 0.1197 0.3806 -3.23250.3350 0.6221 0.1006 0.3644 -3.25550.3400 0.6226 0.0819 0.3480 -3.27820.3450 0.6229 0.0636 0.3316 -3.30060.3500 0.6232 0.0458 0.3150 -3.32270.3550 0.6234 0.0286 0.2983 -3.34440.3600 0.6235 0.0119 0.2816 -3.36580.3650 0.6235 -0.0041 0.2647 -3.38680.3700 0.6234 -0.0195 0.2477 -3.40740.3750 0.6233 -0.0342 0.2306 -3.42750.3800 0.6231 -0.0481 0.2134 -3.44710.3850 0.6228 -0.0612 0.1961 -3.46620.3900 0.6225 -0.0736 0.1788 -3.48460.3950 0.6221 -0.0851 0.1613 -3.50240.4000 0.6216 -0.0958 0.1437 -3.51950.4050 0.6211 -0.1057 0.1261 -3.53580.4100 0.6206 -0.1147 0.1084 -3.55140.4150 0.6200 -0.1229 0.0906 -3.56600.4200 0.6194 -0.1302 0.0727 -3.57980.4250 0.6187 -0.1367 0.0548 -3.59260.4300 0.6180 -0.1423 0.0368 -3.60430.4350 0.6173 -0.1472 0.0188 -3.61500.4400 0.6165 -0.1513 0.0007 -3.62450.4450 0.6158 -0.1546 -0.0175 -3.6329

0.4500 0.6150 -0.1572 -0.0357 -3.64000.4550 0.6142 -0.1591 -0.0539 -3.64580.4600 0.6134 -0.1603 -0.0721 -3.65020.4650 0.6126 -0.1610 -0.0904 -3.65330.4700 0.6118 -0.1611 -0.1087 -3.65500.4750 0.6110 -0.1606 -0.1269 -3.65520.4800 0.6102 -0.1597 -0.1452 -3.65390.4850 0.6094 -0.1584 -0.1635 -3.65100.4900 0.6086 -0.1568 -0.1817 -3.64660.4950 0.6078 -0.1548 -0.1999 -3.64070.5000 0.6070 -0.1526 -0.2181 -3.6331

>> plot(A(:,1),180*A(:,4)/pi,'r')(Tiempo * Grados sexagecimales)grid onaxis on>> plot(A(:,1),A(:,2),'r')xlabel('tiempo')ylabel('radio')

Figura 2 . Diagrama de Posición en función del tiempo – Péndulo Elástico

Page 6: PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

MÉTODOS MATEMÁTICOS Y NUMÉRICOS PARA INGENIERÍA 6FECHA: MAYO 2011

Si deseamos saber la posición de rcuando el péndulo llega a 0°, se tendría losiguiente:

El tiempo que la masa del péndulo llega ala posición:Θ=0° t=0.44 s.

Figura 3. Diagrama de radio en función del tiempo – Péndulo Elástico.

Figura 4. Diagrama para determinar el tiempo cuando Θ=0°

Page 7: PENDULO ELASTICO METODO RUNGE KUTTA 4 CON MATLAB

MÉTODOS MATEMÁTICOS Y NUMÉRICOS PARA INGENIERÍA 7FECHA: MAYO 2011

4. CONCLUSIONES

En este trabajo, se pudo demostrar que sies posible solucionar ecuacionesdiferenciales por métodos numéricos queen este caso el Runge Kutta 4, aplicado alpéndulo elástico, también se demostróque cuando se hace la variación de lalongitud “L”, la intensidad del movimientooscilatorio aumenta con una mayorelongación de la cuerda elástica, dentrodel campo de las vibraciones este péndulose consideraría como un sistema con dosgrados de libertar clasificado como unavibración libre debido por solo a lapresencia de las fuerzas gravitatorias yelásticas,

5. REFERENCIAS

Zekeyra Girgin, Ersin Demir 2008,Investigation of elastic pendulumoscillations by simulation technique, 81-86.

Jorge Rodriguez Hernandez, 2010,Dinamica, Cap II, Cap X

Chang, C.L and Lee 2004, Applyng thedouble side method to solution no linearpendulum problem, Appl. Math Comput149, 613-624

Georgiou, I. T. 1999. On the globalgeometricstructure of the dynamics of the elasticpendulum, Nonlinear Dynam. 18, 51-68.Girgin, Z. 2008. Combining differentialquadrature method with simulationtechnique to solve nonlinear differentialequations, Int. J. Numer. Meth. Eng. 75(6), 722-734.

Figura 5. Diagrama de comparación – para dos casos de L (L1=0.5m y L2=0.575m)