import numpy as np
import matplotlib.pyplot as plt
m = 0.0236205
k = 3.73
omega = np.power(k/m,1.0/2.0)
T = (2.0*np.pi)/omega
F0 = 4.0
delta = 0.001
t = np.arange(10,3000)*delta
F = np.zeros(2990)
G = np.sin(omega*t)
Rd = np.zeros(400)
tT = np.linspace(0.01,6,400)
plt.figure(figsize=(19,8.5))
for j in range(tT.size):
for i in range(t.size):
if t[i] <= T*tT[j]:
F[i] = F0
else:
F[i] = 0.0
posicion = np.convolve(F,G)*delta/(m*omega)
posicion = posicion[:2990]
plt.plot(t, np.abs(posicion))
Rd[j] = max(posicion)*k/F0
plt.xlabel(r'$t$')
plt.ylabel(r'$u$')
plt.grid(True)
plt.show()
plt.figure(figsize=(19,8.5))
plt.plot(tT, Rd)
plt.xlabel(r'$\frac{t_{1}}{T}$')
plt.ylabel(r'$R_{d}$')
plt.grid(True)
plt.show()
print 'Rd max =', max(Rd)
import numpy as np
import matplotlib.pyplot as plt
m = 0.0236205
k = 3.73
omega = np.power(k/m,1.0/2.0)
T = (2.0*np.pi)/omega
F0 = 4.0
delta = 0.001
t = np.arange(10,3000)*delta
F = np.zeros(2990)
G = np.sin(omega*t)
Rd = np.zeros(400)
tT = np.linspace(0.01,6,400)
plt.figure(figsize=(19,8.5))
for j in range(tT.size):
for i in range(t.size):
if t[i] <= T*tT[j]:
F[i] = F0*np.sin(np.pi*t[i]/(T*tT[j]))
else:
F[i] = 0.0
posicion = np.convolve(F,G)*delta/(m*omega)
posicion = posicion[:2990]
plt.plot(t, np.abs(posicion))
Rd[j] = max(posicion)*k/F0
plt.xlabel(r'$t$')
plt.ylabel(r'$u$')
plt.grid(True)
plt.show()
plt.figure(figsize=(19,8.5))
plt.plot(tT, Rd)
plt.xlabel(r'$\frac{t_{1}}{T}$')
plt.ylabel(r'$R_{d}$')
plt.grid(True)
plt.show()
print 'Rd max =', max(Rd)
import numpy as np
import matplotlib.pyplot as plt
m = 0.0236205
k = 3.73
omega = np.power(k/m,1.0/2.0)
T = (2.0*np.pi)/omega
F0 = 4.0
delta = 0.001
t = np.arange(10,3000)*delta
F = np.zeros(2990)
G = np.sin(omega*t)
Rd = np.zeros(400)
tT = np.linspace(0.01,6,400)
plt.figure(figsize=(19,8.5))
for j in range(tT.size):
for i in range(t.size):
if t[i] <= T*tT[j]*0.5:
F[i] = (F0*t[i])/(T*tT[j]*0.5)
elif T*tT[j]*0.5 < t[i] <= T*tT[j]:
F[i] = -(F0*(t[i] - T*tT[j]*0.5))/(T*tT[j] - T*tT[j]*0.5) + F0
else:
F[i] = 0
posicion = np.convolve(F,G)*delta/(m*omega)
posicion = posicion[:2990]
plt.plot(t, np.abs(posicion))
Rd[j] = max(posicion)*k/F0
plt.xlabel(r'$t$')
plt.ylabel(r'$u$')
plt.grid(True)
plt.show()
plt.figure(figsize=(19,8.5))
plt.plot(tT, Rd)
plt.xlabel(r'$\frac{t_{2}}{T}$')
plt.ylabel(r'$R_{d}$')
plt.grid(True)
plt.show()
print 'Rd max =', max(Rd)