Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Sistema Masa Resorte
Sistema Masa Resorte
In [12]: y=data.ix[:,2]
/home/paola/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
1
In [5]: plt.plot(x,y,'ro')
plt.ylabel('ffff')
plt.xlabel('ffff')
plt.show
In [6]: coeficientes=np.polyfit(x,y,30)
polinomio=np.poly1d(coeficientes)
print(polinomio)
30 29 28 27
-2.627e-17 x + 1.249e-15 x - 2.017e-14 x + 7.248e-14 x
26 25 24 23
+ 1.102e-12 x - 4.21e-12 x - 8.642e-11 x + 1.398e-11 x
22 21 20 19
+ 6.42e-09 x + 2.684e-08 x - 3.697e-07 x - 3.684e-06 x
18 17 16 15
+ 1.398e-05 x + 0.0003414 x - 0.0001421 x - 0.02788 x
14 13 12 11 10 9
- 0.007793 x + 2.31 x - 5.972 x - 163 x + 1937 x - 1.121e+04 x
8 7 6 5 4
+ 4.123e+04 x - 1.033e+05 x + 1.797e+05 x - 2.146e+05 x + 1.701e+05 x
3 2
- 8.39e+04 x + 2.282e+04 x - 2650 x + 139.3
2
/home/paola/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:1: RankWarning: Polyfit
"""Entry point for launching an IPython kernel.
In [7]: inter=polinomio(x)
plt.plot(x,inter,'-')
corte=0*x +88
plt.plot(x,corte,'-')
A=polinomio
F
k=
x
para encontrar f se tiene encuenta la fuerza de empuje del agua así:
mg − Fe = kx
In [15]: k=((0.2*9.8)-(997*9.8)*(4/3)*(np.pi)*(0.015)**3)/0.045
print (k)
40.48603103743912
3
el cálculo del cuasi-periodo se hace teniendo en cuenta el tiempo entre dos máximos o dos
mínimos consecutivos
√
γ
w = ω02 − ( )2
2
despejando √
16π 2
γ = 2ω02 −
T2
In [21]: w2=(40.48603103743912/0.2)
print(w2)
202.4301551871956
17.991188231956514
0.3 √
− γ2 x γ
y = Ae cos ω 2 − ( )2 x + ϕ
2
In [36]: import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import sympy
from sympy import *
from sympy import Derivative, diff, simplify,exp,cos,sin
/home/cesar/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:3: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
4
In [22]: from scipy.optimize import curve_fit
In [23]: (A,g,f),_=curve_fit(funcion,xdat,ydat)
In [25]: curve_fit(funcion,xdat,ydat)
In [26]:
In [27]: plt.plot(x,funcion(x,A,g,f),label='ajuste')
In [41]: x= sympy.symbols('x')
sympy.diff(-28.846508940641947*exp((-3.19903998121555/2)*x)*cos(sqrt((40.48/0.2) -((3.
5
In [42]: def dx(x):
return 407.78959551621*np.exp(-1.59951999060778*x)*np.sin(14.1365319580032*x - 9.9
In [46]: x=np.linspace(0,8,1000)
plt.plot(x,dx(x),label='ajuste')
Out[46]: [<matplotlib.lines.Line2D at 0xa75d36cc>]
1 Energía disipada
∆E = E f − Ei
1
∆E = 0 − (mgh + kx2 )
2
1
∆E = 0 − (0.2 + 9.8 ∗ 0.045 + (40.48)(0.045)2 )
2
6
In [9]: DE = (0.2*9.8*0.045+ (1/2)*(40.48)*(0.045)**2)
print (DE)
0.129186
In [ ]: