Skip to content
Snippets Groups Projects
Commit ea4c69c5 authored by Oscar Danilo Lopez Jaime's avatar Oscar Danilo Lopez Jaime
Browse files

Eliminar PENDULO_ENTREGA_1.ipynb

parent 6329704a
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
import numpy as np
import matplotlib.pyplot as plt
```
%% Cell type:code id: tags:
``` python
datos= np.genfromtxt('MassB.txt')
```
%% Cell type:code id: tags:
``` python
datos
```
%% Output
array([[4. , 4.02, 4.04, 3.95],
[4.16, 4.18, 4.17, 4.18],
[4.42, 4.41, 4.43, 4.4 ],
[4.87, 4.92, 4.88, 4.88],
[5.14, 5.13, 5.16, 5.14],
[5.26, 5.17, 5.15, 5.24],
[5.43, 5.44, 5.43, 5.46],
[5.7 , 5.74, 5.71, 5.73]])
%% Cell type:code id: tags:
``` python
t=datos/5
t
```
%% Output
array([[0.8 , 0.804, 0.808, 0.79 ],
[0.832, 0.836, 0.834, 0.836],
[0.884, 0.882, 0.886, 0.88 ],
[0.974, 0.984, 0.976, 0.976],
[1.028, 1.026, 1.032, 1.028],
[1.052, 1.034, 1.03 , 1.048],
[1.086, 1.088, 1.086, 1.092],
[1.14 , 1.148, 1.142, 1.146]])
%% Cell type:raw id: tags:
# datos promedios del Periodo
%% Cell type:code id: tags:
``` python
tp=t[0]
T1=np.mean(tp)
T1
#14cm#
```
%% Output
0.8005
%% Cell type:code id: tags:
``` python
tp2=t[1]
T2=np.mean(tp2)
T2
#16cm#
```
%% Output
0.8345
%% Cell type:code id: tags:
``` python
tp3=t[2]
T3=np.mean(tp3)
T3
#18cm#
```
%% Output
0.883
%% Cell type:code id: tags:
``` python
tp4=t[3]
T4=np.mean(tp4)
T4
#22cm#
```
%% Output
0.9775
%% Cell type:code id: tags:
``` python
tp5=t[4]
T5=np.mean(tp5)
T5
#24cm#
```
%% Output
1.0285000000000002
%% Cell type:code id: tags:
``` python
tp6=t[5]
T6=np.mean(tp6)
T6
#26cm#
```
%% Output
1.0410000000000001
%% Cell type:code id: tags:
``` python
tp7=t[6]
T7=np.mean(tp7)
T7
#28cm#
```
%% Output
1.088
%% Cell type:code id: tags:
``` python
tp8=t[7]
T8=np.mean(tp8)
T8
#30cm#
```
%% Output
1.1440000000000001
%% Cell type:code id: tags:
``` python
def gravedad (l,T_p):
g=4*np.pi**2*l/T_p**2
return (g)
```
%% Cell type:code id: tags:
``` python
g1=gravedad(0.14,T1)
print (g1)
```
%% Output
8.625119082912407
%% Cell type:code id: tags:
``` python
g2=gravedad(0.16,T2)
print (g2)
```
%% Output
9.070412483082855
%% Cell type:code id: tags:
``` python
g3=gravedad(0.18,T3)
print (g3)
```
%% Output
9.11403799307716
%% Cell type:code id: tags:
``` python
g4=gravedad(0.24,T4)
print (g4)
```
%% Output
10.018247540046165
%% Cell type:code id: tags:
``` python
g5=gravedad(0.22,T5)
print (g5)
```
%% Output
8.210579781959067
%% Cell type:code id: tags:
``` python
g6=gravedad(0.24,T6)
print (g6)
```
%% Output
8.743182011169136
%% Cell type:code id: tags:
``` python
g7=gravedad(0.26,T7)
print (g7)
```
%% Output
8.671121946242542
%% Cell type:code id: tags:
``` python
g8=gravedad(0.30,T8)
print (g8)
```
%% Output
9.049590812285462
%% Cell type:code id: tags:
``` python
G=[g1,g2,g3,g4,g5,g6,g7,g8]
G
```
%% Output
[8.625119082912407,
9.070412483082855,
9.11403799307716,
10.018247540046165,
8.210579781959067,
8.743182011169136,
8.671121946242542,
9.049590812285462]
%% Cell type:code id: tags:
``` python
g_prom=np.mean(G)
g_prom
```
%% Output
8.93778645634685
%% Cell type:code id: tags:
``` python
T_p=np.array([T1,T2,T3,T4,T5,T6,T7,T8])
T_p
```
%% Output
array([0.8055, 0.8345, 0.883 , 0.9725, 1.0275, 1.041 , 1.088 , 1.144 ])
%% Cell type:code id: tags:
``` python
t_err=t.std(axis=1)
t_err
```
%% Output
array([0.00668954, 0.00165831, 0.00223607, 0.00384057, 0.00217945,
0.00921954, 0.00244949, 0.00316228])
%% Cell type:code id: tags:
``` python
l=np.arange(14,31,2)
L=l/100
L_list=L.tolist()
L_list
```
%% Output
[0.14, 0.16, 0.18, 0.2, 0.22, 0.24, 0.26, 0.28, 0.3]
%% Cell type:code id: tags:
``` python
del L_list[3]
L_list
L_p=np.array(L_list)
```
%% Cell type:code id: tags:
``` python
l_err=L_p.std()
l_err
```
%% Output
0.054256336035526764
%% Cell type:code id: tags:
``` python
plt.figure()
plt.errorbar(T_p,L_p,l_err,t_err,fmt='o',color='k')
plt.xlabel('T(s)')
plt.ylabel('l(m)')
plt.show()
```
%% Output
%% Cell type:code id: tags:
``` python
Y= np.log(np.abs(T_p))
Y
```
%% Output
array([-0.21629208, -0.18092254, -0.12443008, -0.0278852 , 0.02712867,
0.04018179, 0.08434115, 0.13453089])
%% Cell type:code id: tags:
``` python
X=np.log(2*np.pi*np.sqrt(L_p/g_prom))
X
```
%% Output
array([-0.24032334, -0.17355764, -0.11466613, -0.01433078, 0.02917491,
0.06919626, 0.10625025, 0.14074668])
%% Cell type:code id: tags:
``` python
plt.figure()
plt.plot(X,Y)
```
%% Output
[<matplotlib.lines.Line2D at 0x5ae46e0>]
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment