Vibración forzada sin amortiguamiento

\begin{equation*} m \ddot{u} + k u = F_{0} \sin \bigl( \bar{\omega} t \bigr) \end{equation*}

Reescribiendo la ecuación

\begin{equation} \ddot{u} + \omega^{2} u = \frac{F_{0}}{m} \sin \bigl( \bar{\omega} t \bigr) \end{equation}

La solución es

\begin{equation*} u = A_{1} \sin \bigl( \omega t \bigr) + A_{2} \cos \bigl( \omega t \bigr) + G \sin \bigl( \bar{\omega} t \bigr) \end{equation*}

Coeficientes

\begin{align*} \gamma &= \frac{\bar{\omega}}{\omega} \\ A_{1} &= \frac{\dot{u}_{0}}{\omega} - \frac{F_{0}}{k} \frac{\gamma}{1 - \gamma^{2}}\\ A_{2} &= u_{0} \\ G &= \frac{F_{0}}{k} \frac{1}{1 - \gamma^{2}} \end{align*}

Ejemplo en clase

Usando

\begin{equation*} u = A \sin \bigl( \omega t \bigr) + B \cos \bigl( \omega t \bigr) + G \sin \bigl( \bar{\omega} t \bigr) \end{equation*}

In [1]:
import numpy as np
import matplotlib.pyplot as plt

w = 25.0  # Tn
m = w/981.0 # Tn/cm/seg^2
k = 7.0  # Tn/cm
u0 = 0.0  # cm
v0 = 0.0 # cm/seg
beta = 0.07
F0 = 2.0
omega_bar = 18.1

omega = np.power(k/m,1.0/2.0)
gamma = omega_bar/omega
G = (F0/k)*(1.0)/(1.0 - gamma**2)
A = (v0/omega) - (F0/k)*(gamma)/(1.0 - gamma**2)
B = u0

print 'omega =', omega
print 'gamma =',gamma
print 'G =', G
print 'A =', A
print 'B =', B
omega = 16.5734727803
gamma = 1.09210665984
G = -1.48271301719
A = 1.6192807607
B = 0.0
In [2]:
t = np.linspace(0,15,15000)
posicion = A*np.sin(omega*t) + B*np.cos(omega*t) + G*np.sin(omega_bar*t) 

plt.figure(figsize=(19,8.5))
plt.plot(t,posicion)
plt.xlabel(r'$t$  seg.')
plt.ylabel(r'$u$  cm.')
plt.grid(True)
plt.show()

Cuando $u_{0} = 0$ y $\dot{u}_{0} = 0$

\begin{equation*} u = A_{1} \sin \bigl( \omega t \bigr) + G \sin \bigl( \bar{\omega} t \bigr) \end{equation*}

Coeficientes

\begin{align*} \gamma &= \frac{\bar{\omega}}{\omega} \\ A_{1} &= - \frac{F_{0}}{k} \frac{\gamma}{1 - \gamma^{2}}\\ G &= \frac{F_{0}}{k} \frac{1}{1 - \gamma^{2}} \end{align*}

In [3]:
import numpy as np
import matplotlib.pyplot as plt

w = 25.0  # Tn
m = w/981.0 # Tn/cm/seg^2
k = 7.0  # Tn/cm
beta = 0.07
F0 = 2.0
omega_bar = 18.1

omega = np.power(k/m,1.0/2.0)
gamma = omega_bar/omega
G = (F0/k)*(1.0)/(1.0 - gamma**2)
A = -(F0/k)*(gamma)/(1.0 - gamma**2)

print 'omega =', omega
print 'gamma =',gamma
print 'G =', G
print 'A =', A
omega = 16.5734727803
gamma = 1.09210665984
G = -1.48271301719
A = 1.6192807607
In [4]:
t = np.linspace(0,15,15000)
posicion = A*np.sin(omega*t) + G*np.sin(omega_bar*t) 

plt.figure(figsize=(19,8.5))
plt.plot(t,posicion)
plt.xlabel(r'$t$  seg.')
plt.ylabel(r'$u$  cm.')
plt.grid(True)
plt.show()

Usando odeint

\begin{align*} u^{\prime} &= z \\ z^{\prime} + \omega^{2} u &= \frac{F_{0}}{m} \sin \bigl( \bar{\omega} t \bigr) \end{align*}

sujeto a $u(0) = 0$ y $u^{\prime}(0) = 0$

In [5]:
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt

def dU_dx(U, x):
    # Here U is a vector such that y=U[0] and z=U[1]. This function should return [z', u']
    m = 25.0/981.0
    k = 7.0
    omega = np.power(k/m,1.0/2.0)
    F0 = 2.0
    omega_bar = 18.1 
    return [U[1],-omega**2*U[0] + (F0/m)*np.sin(omega_bar*x)]
U0 = [0.0,0.0]
#U0 = [6.5,32.0]
xs = np.linspace(0, 15, 15000)
Us = odeint(dU_dx, U0, xs)
ys = Us[:,0]

plt.figure(figsize=(19,8.5))
plt.plot(xs, ys)
plt.xlabel(r'$t$  seg.')
plt.ylabel(r'$u$  cm.')
plt.grid(True)
plt.show()

Valor máximo aproximado

In [6]:
valor_pico = np.where(posicion >= max(posicion))[0]
print 't pico =', t[valor_pico[0]]
print 'valor pico =', posicion[valor_pico[0]]
t pico = 6.16141076072
valor pico = 3.1018116753

Gráfico interactivo

In [7]:
import plotly.offline as offline
import plotly.graph_objs as go
import numpy as np

offline.init_notebook_mode()

t = np.linspace(0,15,15000)
posicion = A*np.sin(omega*t) + B*np.cos(omega*t) + G*np.sin(omega_bar*t) 
trace = go.Scatter(x = t, y = posicion)
data = [trace]

offline.iplot(data)

Desplazamientos máximos

Usando la transformada de Hilbert

In [8]:
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hilbert

t = np.linspace(0,15,15000)
posicion = A*np.sin(omega*t) + B*np.cos(omega*t) + G*np.sin(omega_bar*t)
analytic_signal = hilbert(posicion)
amplitude_envelope = np.abs(analytic_signal)
instantaneous_phase = np.unwrap(np.angle(analytic_signal))
instantaneous_frequency = (np.diff(instantaneous_phase)/(2.0*np.pi))
fig = plt.figure(figsize=(19,8.5))
ax0 = fig.add_subplot(211)
ax0.plot(t, posicion, label='posicion')
ax0.plot(t, amplitude_envelope, label='envolvente')
ax0.set_xlabel("tiempo en segundos")
ax0.legend()
ax1 = fig.add_subplot(212)
ax1.plot(t[1:], instantaneous_frequency)
ax1.set_xlabel("tiempo en segundos")

plt.show()

Usando argrelextrema

In [9]:
import numpy as np
from scipy.signal import argrelextrema
import matplotlib.pyplot as plt

t = np.linspace(0,15,15000)
posicion = A*np.sin(omega*t) + B*np.cos(omega*t) + G*np.sin(omega_bar*t)

maximo = argrelextrema(posicion, np.greater)[0] #array of indexes of the locals maxima
x = [t[maximo] for i in maximo][0]
y = [posicion[maximo] for i in maximo][0]

plt.figure(figsize=(19,8.5))
plt.plot(t,posicion)
plt.plot(x, y, 'ro')
plt.xlabel(r'$t$  seg.')
plt.ylabel(r'$u$  cm.')
plt.show() 

Desplazamiento máximo

In [10]:
for i in range(np.size(x)):
    print i, '\t', round(x[i],3), '\t', round(y[i],3)
0 	0.181 	0.428
1 	0.544 	1.25
2 	0.906 	1.978
3 	1.268 	2.556
4 	1.631 	2.939
5 	1.993 	3.098
6 	2.356 	3.022
7 	2.718 	2.716
8 	3.08 	2.204
9 	3.443 	1.524
10 	3.805 	0.728
11 	4.116 	-0.107
12 	4.349 	0.549
13 	4.711 	1.362
14 	5.074 	2.071
15 	5.436 	2.623
16 	5.798 	2.976
17 	6.161 	3.102
18 	6.523 	2.992
19 	6.886 	2.655
20 	7.248 	2.116
21 	7.611 	1.416
22 	7.974 	0.609
23 	8.232 	-0.133
24 	8.517 	0.669
25 	8.88 	1.471
26 	9.242 	2.161
27 	9.604 	2.686
28 	9.967 	3.008
29 	10.329 	3.101
30 	10.692 	2.958
31 	11.054 	2.59
32 	11.416 	2.025
33 	11.779 	1.306
34 	12.141 	0.488
35 	12.348 	-0.059
36 	12.685 	0.788
37 	13.047 	1.578
38 	13.41 	2.247
39 	13.772 	2.746
40 	14.134 	3.035
41 	14.497 	3.095
42 	14.859 	2.918

Periodo aproximado

In [11]:
for i in range(np.size(x) - 1):
    print i+1, '\t', x[i+1]-x[i]
1 	0.363024201613
2 	0.362024134942
3 	0.362024134942
4 	0.363024201613
5 	0.362024134942
6 	0.363024201613
7 	0.362024134942
8 	0.362024134942
9 	0.363024201613
10 	0.362024134942
11 	0.311020734716
12 	0.233015534369
13 	0.362024134942
14 	0.363024201613
15 	0.362024134942
16 	0.362024134942
17 	0.363024201613
18 	0.362024134942
19 	0.363024201613
20 	0.362024134942
21 	0.362024134942
22 	0.363024201613
23 	0.258017201147
24 	0.285019001267
25 	0.363024201613
26 	0.362024134942
27 	0.362024134942
28 	0.363024201613
29 	0.362024134942
30 	0.363024201613
31 	0.362024134942
32 	0.362024134942
33 	0.363024201613
34 	0.362024134942
35 	0.20701380092
36 	0.337022468165
37 	0.362024134942
38 	0.363024201613
39 	0.362024134942
40 	0.362024134942
41 	0.363024201613
42 	0.362024134942

Resonancia

\begin{equation*} u = - \frac{F_{0}}{k} \frac{\gamma}{1 - \gamma^{2}} \sin \bigl( \omega t \bigr) + \frac{F_{0}}{k} \frac{1}{1 - \gamma^{2}} \sin \bigl( \bar{\omega} t \bigr) \end{equation*}

Se produce cuando $\gamma = 1$

\begin{equation*} \lim_{\gamma \to 1} u = - \frac{F_{0}}{k} \frac{\gamma}{1 - \gamma^{2}} \sin \bigl( \omega t \bigr) + \frac{F_{0}}{k} \frac{1}{1 - \gamma^{2}} \sin \bigl( \gamma \omega t \bigr) = - \frac{F_{0}}{2 k} \omega t \cos \bigl( \omega t \bigr) + \frac{F_{0}}{2 k} \sin \bigl( \omega t \bigr) \end{equation*}

In [12]:
t = np.linspace(0,15,15000)
posicion = (-F0/k)*omega*t*np.cos(omega*t) + (F0/k)*np.sin(omega*t) 

plt.figure(figsize=(19,8.5))
plt.plot(t,posicion)
plt.xlabel(r'$t$  seg.')
plt.ylabel(r'$u$  cm.')
plt.grid(True)
plt.show()