\begin{equation*} m \ddot{u} + c \dot{u} + k u = F_{0} \sin \bigl( \bar{\omega} t \bigr) \end{equation*}
reescribiendo la ecuación
\begin{equation} \ddot{u} + 2 \beta \omega \dot{u} + \omega^{2} u = \frac{F_{0}}{m} \sin \bigl( \bar{\omega} t \bigr) \end{equation}
La solución es
\begin{equation*} u = e^{-\beta \omega t} \bigl[ A_{1} \sin \bigl( \omega_{d} t \bigr) + A_{2} \cos \bigl( \omega_{d} t \bigr) \bigr] + G_{1} \sin \bigl( \bar{\omega} t \bigr) + G_{2} \cos \bigl( \bar{\omega} t \bigr) \end{equation*}
Coeficientes
\begin{align*} \gamma &= \frac{\bar{\omega}}{\omega} \\ G_{1} &= \frac{F_{0}}{k} \frac{1 - \gamma^{2}}{\bigl( 1 - \gamma^{2} \bigr)^{2} + \bigl( 2 \beta \gamma \bigr)^{2}} \\ G_{2} &= \frac{F_{0}}{k} \frac{-2 \beta \gamma}{\bigl( 1 - \gamma^{2} \bigr)^{2} + \bigl( 2 \beta \gamma \bigr)^{2}} \\ A_{1} &= -\frac{G_{2} \beta \omega + G_{1} \bar{\omega}}{\omega_{d}} = -\frac{G_{2} \beta + G_{1} \gamma}{\sqrt{1 - \beta^{2}}} \\ A_{2} &= -G_{2} \end{align*}
Usando
\begin{equation*} u = e^{-\beta \omega t} \bigl[ A \sin \bigl( \omega_{d} t \bigr) + B \cos \bigl( \omega_{d} t \bigr) \bigr] + G_{1} \sin \bigl( \bar{\omega} t \bigr) + G_{2} \cos \bigl( \bar{\omega} t \bigr) \end{equation*}
import numpy as np
import matplotlib.pyplot as plt
w = 25.0 # Tn
m = w/981 # 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 = 21.1
omega = np.power(k/m,1.0/2.0)
omega_damping = omega*np.power(1-beta**2,1.0/2.0)
gamma = omega_bar/omega
G1 = (F0/k)*(1 - gamma**2)/((1 - gamma**2)**2 + (2*beta*gamma)**2)
G2 = (F0/k)*(-2*beta*gamma)/((1 - gamma**2)**2 + (2*beta*gamma)**2)
A = -(G2*beta*omega + G1*omega_bar)/omega_damping
B = -G2
theta = np.arctan(-A/B)
a = np.sqrt(A**2 + B**2)
T = (2.0*np.pi)/omega
T_damping = (2.0*np.pi)/omega_damping
print 'omega =', omega
print 'omega_damping =',omega_damping
print 'gamma =',gamma
print 'G1 =', G1
print 'G2 =', G2
print 'A =', A
print 'B =', B
print 'theta =', theta
print 'a =', a
print 'T =', T
print 'T_damping =', T_damping
t = np.linspace(0,6,6000)
posicion = np.exp(-beta*omega*t)*(A*np.sin(omega_damping*t) + B*np.cos(omega_damping*t)) + G1*np.sin(omega_bar*t) + G2*np.cos(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} + 2 \beta \omega z + \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$
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)
beta = 0.07
F0 = 2.0
omega_bar = 21.1
return [U[1],-2.0*beta*omega*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, 6, 6000)
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
valor_pico = np.where(posicion >= max(posicion))[0]
print 't pico =', t[valor_pico[0]]
print 'valor pico =', posicion[valor_pico[0]]
Gráfico interactivo
import plotly.offline as offline
import plotly.graph_objs as go
import numpy as np
offline.init_notebook_mode()
t = np.linspace(0,6,6000)
posicion = np.exp(-beta*omega*t)*(A*np.sin(omega_damping*t) + B*np.cos(omega_damping*t)) + G1*np.sin(omega_bar*t) + G2*np.cos(omega_bar*t)
trace = go.Scatter(x = t, y = posicion)
data = [trace]
offline.iplot(data)
Usando la transformada de Hilbert
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hilbert
t = np.linspace(0,6,6000)
posicion = np.exp(-beta*omega*t)*(A*np.sin(omega_damping*t) + B*np.cos(omega_damping*t)) + G1*np.sin(omega_bar*t) + G2*np.cos(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
import numpy as np
from scipy.signal import argrelextrema
import matplotlib.pyplot as plt
t = np.linspace(0,6,6000)
posicion = np.exp(-beta*omega*t)*(A*np.sin(omega_damping*t) + B*np.cos(omega_damping*t)) + G1*np.sin(omega_bar*t) + G2*np.cos(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 aproximado
for i in range(np.size(x)):
print i, '\t', round(x[i],3), '\t', round(y[i],3)
Periodo aproximado
for i in range(np.size(x) - 1):
print i+1, '\t', x[i+1]-x[i]
Se produce cuando $\gamma = 1$
import numpy as np
import matplotlib.pyplot as plt
w = 25.0 # Tn
m = w/981 # 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 = np.power(k/m,1.0/2.0)
omega = np.power(k/m,1.0/2.0)
omega_damping = omega*np.power(1-beta**2,1.0/2.0)
gamma = omega_bar/omega
G1 = (F0/k)*(1 - gamma**2)/((1 - gamma**2)**2 + (2*beta*gamma)**2)
G2 = (F0/k)*(-2*beta*gamma)/((1 - gamma**2)**2 + (2*beta*gamma)**2)
A = -(G2*beta*omega + G1*omega_bar)/omega_damping
B = -G2
theta = np.arctan(-A/B)
a = np.sqrt(A**2 + B**2)
T = (2.0*np.pi)/omega
T_damping = (2.0*np.pi)/omega_damping
print 'omega =', omega
print 'omega_damping =',omega_damping
print 'gamma =',gamma
print 'G1 =', G1
print 'G2 =', G2
print 'A =', A
print 'B =', B
print 'theta =', theta
print 'a =', a
print 'T =', T
print 'T_damping =', T_damping
t = np.linspace(0,6,6000)
posicion = np.exp(-beta*omega*t)*(A*np.sin(omega_damping*t) + B*np.cos(omega_damping*t)) + G1*np.sin(omega_bar*t) + G2*np.cos(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()
Amplitud
\begin{equation*} \sqrt{G_{1} + G_{2}} = \frac{F_{0}}{k} \frac{1}{\sqrt{ \bigl( 1 - \gamma^{2} \bigr)^{2} + \bigl( 2 \beta \gamma \bigr)^{2}}} \end{equation*}
Transmisibilidad
\begin{equation*} T = \frac{\sqrt{G_{1} + G_{2}}}{\frac{F_{0}}{k}} = \frac{1}{\sqrt{ \bigl( 1 - \gamma^{2} \bigr)^{2} + \bigl( 2 \beta \gamma \bigr)^{2}}} \end{equation*}
gamma = np.linspace(0,6,6000)
T1 = 1/np.sqrt((1-gamma**2)**2 + (2*0.05*gamma)**2)
T2 = 1/np.sqrt((1-gamma**2)**2 + (2*0.1*gamma)**2)
T3 = 1/np.sqrt((1-gamma**2)**2 + (2*0.2*gamma)**2)
T4 = 1/np.sqrt((1-gamma**2)**2 + (2*0.3*gamma)**2)
plt.figure(figsize=(11,8.5))
plt.plot(gamma,T1, label=r'$\beta = 5\%$')
plt.plot(gamma,T2, label=r'$\beta = 10\%$')
plt.plot(gamma,T3, label=r'$\beta = 20\%$')
plt.plot(gamma,T4, label=r'$\beta = 30\%$')
plt.legend()
plt.xlabel(r'$\gamma$')
plt.ylabel(r'$\frac{\sqrt{G_{1} + G_{2}}}{\frac{F_{0}}{k}}$')
plt.grid(True)
plt.show()