Diferencia entre revisiones de «Sistemas resorte-masa»

De MateWiki
Saltar a: navegación, buscar
Línea 34: Línea 34:
  
 
<math>y_{n+1} = y_n + hz_n + h^2(betaf_n+1 + (1/2 - beta)f_n)</math>
 
<math>y_{n+1} = y_n + hz_n + h^2(betaf_n+1 + (1/2 - beta)f_n)</math>
<math>z_{n+1} = z_n + h(gammaf_(n+1) + (1 - gamma)f_n); </math>
+
<math>z_{n+1} = z_n + h(gammaf_(n+1) + (1 - gamma)f_n)</math>
  
  

Revisión del 01:17 5 mar 2013

1 Sistemas resorte-masa

Consideremos un sistema formado por dos masas ancladas a la pared por los muelles de constantes k1 y k3, y unidos entre ellos por otro de constante k2, tal y como se indica en el dibujo.

El objetivo será deducir las ecuaciones del movimiento de cada masa. Para ello, establecemos dos parámetros “x” e “y” que nos indican los desplazamientos de las masas respecto de su posición de equilibrio respectivamente. (NOTA: Tomaremos el desplazamiento positivo hacia la derecha). Aplicando las ecuaciones de la mecánica clásica (Newton- Euler), tenemos que:

[math]\left\{\begin{matrix}m_{1}\ddot x=k_{2}(y-x)-k_{1}x\\m_{2}\ddot y=-k_{3}y-k_{2}(y-x)\end{matrix}\right.[/math]

2 Aproximación de la posición mediante métodos numéricos

Para aplicar tanto Runge-Kutta como Newmark necesitamos un sistema de ecuaciones donde sólo haya derivadas primeras, para ello hacemos los siguientes cambios de variable:

[math]\dot x=u[/math]: [math]\dot y=v[/math]

Y así obtenemos el sistema: [math]\left\{\begin{matrix}m_{1}\ddot x=k_{2}(y-x)-k_{1}x\\m_{2}\ddot y=-k_{3}y-k_{2}(y-x)\\\dot x=u\\\dot y=v\end{matrix}\right.[/math]

3 Método Runge-Kutta

Para poder aplicar el método necesitamos pasar el sistema de ecuaciones a uno matricial, obteniendo así M




4 Método de Newmark

Para aplicar el método de Newmark lo primero que se debe hacer es introducir dos nuevas variables “u” y “v” que serán igual a las velocidades (derivada primera de x e y). A continuación aplicamos las fórmulas del método de Newmark dadas para cada variable, obteniendo 4 ecuaciones en las que solo aparece la primera derivada.


[math]y_{n+1} = y_n + hz_n + h^2(betaf_n+1 + (1/2 - beta)f_n)[/math] [math]z_{n+1} = z_n + h(gammaf_(n+1) + (1 - gamma)f_n)[/math]


We propose an Euler explicit method with time step h,

[math] y_0, \; t_0 [/math]

[math]y_{n+1} = y_{n} + h\cdot y_{n}\cdot(1 - y_{n})[/math]

5 MATLAB code

{{matlab|codigo= % Euler method to solve the logistic equation y'=y(1-y) clear all; t0=0; tN=4;  % initial and final time y0=1/10;  % value of y at time t=0 N=40;  % Number of intervals h=(tN-t0)/40;  % Time step h yy=y0;  % yy -> variable with the solution at each time step y(1)=yy;  % y -> vector where we store the solution for n=1:N

  yy=yy+h*yy*(1-yy);  % numerical scheme
  y(n+1)=yy;          % store the solution

end x=t0:h:tN;  % Draw the solution plot(x,y,'x'); }

6 Results

Consider the particular case: [math] y_0=1/10, \; t_0=0, \; h=1/10 [/math] The exact solution can be computed in this case: [math] y(t)=\frac{e^t}{9+e^t} [/math]


Numerical approximation of the solution
Error = abs( exact solution - numerical approximation)

--Carlos Castro (discusión) 15:09 31 ene 2013 (CET)