import numpy as np
import matplotlib.pyplot as plt
m = 42.0/981.0 # Tn/cm/seg^2
omega = 15.6604597634
F0 = 2.0 # Tn
t1 = 1.0 # segundos
delta = 0.001
t = np.arange(3000)*delta
F = np.zeros(3000)
for i in range(3000):
if t[i] <= t1:
F[i] = F0
else:
F[i] = 0.0
G = np.sin(omega*t)
plt.figure(figsize=(19,8.5))
plt.plot(t,F)
plt.plot(t,G)
plt.xlabel(r'$t$ seg.')
plt.ylabel(r'$F_{0}$')
plt.grid(True)
plt.show()
H = np.convolve(F,G)*delta/(m*omega)
H = H[:3000]
plt.figure(figsize=(19,8.5))
plt.plot(t, H)
plt.xlabel(r'$t$ seg.')
plt.ylabel(r'$u$ cm.')
plt.grid(True)
plt.show()
Usando los datos de un ejemplo anterior
import numpy as np
import matplotlib.pyplot as plt
m = 25.0/981
omega = 16.5734727803
F0 = 2.0
t1 = 0.5
delta = 0.001
t = np.arange(3000)*delta
F = np.zeros(3000)
for i in range(3000):
if t[i] <= t1:
F[i] = F0*np.sin(np.pi*t[i]/t1)
else:
F[i] = 0.0
G = np.sin(omega*t)
plt.figure(figsize=(19,8.5))
plt.plot(t,F)
plt.plot(t,G)
plt.xlabel(r'$t$ seg.')
plt.ylabel(r'$F_{0}$')
plt.grid(True)
plt.show()
H = np.convolve(F,G)*delta/(m*omega)
H = H[:3000]
plt.figure(figsize=(19,8.5))
plt.plot(t, H)
plt.xlabel(r'$t$ seg.')
plt.ylabel(r'$u$ cm.')
plt.grid(True)
plt.show()
Usando los datos de un ejemplo anterior
import numpy as np
import matplotlib.pyplot as plt
m = 30.0/981
omega = 9.90454441153
F0 = 4.5
t1 = 0.3
t2 = 0.6
delta = 0.001
t = np.arange(3000)*delta
F = np.zeros(3000)
for i in range(3000):
if t[i] <= t1:
F[i] = (F0*t[i])/t1
elif t1 < t[i] <= t2:
F[i] = -(F0*(t[i] - t1))/(t2 - t1) + F0
else:
0
G = np.sin(omega*t)
plt.figure(figsize=(19,8.5))
plt.plot(t,F)
plt.plot(t,G)
plt.xlabel(r'$t$ seg.')
plt.ylabel(r'$F_{0}$')
plt.grid(True)
plt.show()
H = np.convolve(F,G)*delta/(m*omega)
H = H[:3000]
plt.figure(figsize=(19,8.5))
plt.plot(t, H)
plt.xlabel(r'$t$ seg.')
plt.ylabel(r'$u$ cm.')
plt.grid(True)
plt.show()