Skip to content
Snippets Groups Projects
Commit c20c8057 authored by Sasiri Juliana Vargas Urbano's avatar Sasiri Juliana Vargas Urbano
Browse files

Cuaderno

parent 5c1e5e39
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,8 @@ import numpy as np ...@@ -6,6 +6,8 @@ import numpy as np
```python ```python
#Para la lectura de archivos
Lista_A = [] Lista_A = []
Lista_B = [] Lista_B = []
...@@ -358,6 +360,8 @@ Lista_A[0] ...@@ -358,6 +360,8 @@ Lista_A[0]
```python ```python
#Perfiles de densidad para cada semilla de random
densidad_ListaA = [] densidad_ListaA = []
densidad_ListaB = [] densidad_ListaB = []
...@@ -395,7 +399,7 @@ grafico(0,densidad_ListaA, densidad_ListaB) ...@@ -395,7 +399,7 @@ grafico(0,densidad_ListaA, densidad_ListaB)
![png](output_5_0.png) ![png](CoNGA_files/CoNGA_5_0.png)
...@@ -406,6 +410,162 @@ grafico(1,densidad_ListaA, densidad_ListaB) ...@@ -406,6 +410,162 @@ grafico(1,densidad_ListaA, densidad_ListaB)
![png](output_6_0.png) ![png](CoNGA_files/CoNGA_6_0.png)
```python
#Densidad de A en Data Frame
densidad_DF_A=pd.DataFrame(densidad_ListaA)
#Densidad de B en Data Frame
densidad_DF_B=pd.DataFrame(densidad_ListaB)
```
0 1.00000
1 0.99758
2 0.99488
3 1.00000
4 1.00000
5 0.99996
6 0.99296
7 0.99978
8 1.00000
9 1.00000
Name: 100, dtype: float64
```python
#Promedio de la densidad de todas las semillas
prom_densidad_ListaA=list(densidad_DF_A.mean())
prom_densidad_ListaB=list(densidad_DF_B.mean())
#Desviacion estandar
desviacion_A = list(densidad_DF_A.std(ddof=0))
desviacion_B = list(densidad_DF_B.std(ddof=0))
fig=plt.figure()
plt.plot(X,prom_densidad_ListaA,c='b')
plt.plot(X,prom_densidad_ListaB,c='r')
#Graficas de barras de error(desviación estándar)
plt.errorbar(X,prom_densidad_ListaA, yerr=desviacion_A, linestyle="None")
plt.errorbar(X,prom_densidad_ListaB,yerr=desviacion_B, linestyle="None")
plt.xticks(np.arange(X[0], X[-1] + 10, step=10))
#plt.text(min(X),0.05,'semilla '+str(semilla),fontsize=10)
plt.legend(['Particulas A', 'Particulas B'],loc='upper right',bbox_to_anchor=(1.35, 1))
plt.xlabel('x')
plt.ylabel('Perfil de densidad')
plt.show()
```
![png](CoNGA_files/CoNGA_8_0.png)
```python
#Gráfica desviación estándar
plt.figure()
plt.plot(X,desviacion_A,c='b')
plt.plot(X,desviacion_B,c='r')
plt.xlabel('x')
plt.ylabel('Desviación estándar')
plt.show()
```
![png](CoNGA_files/CoNGA_9_0.png)
```python
#Valor de mayor desviacion estándar
max_desv_A = np.argmax(desviacion_A)
max_desv_B = np.argmax(desviacion_B)
print(max_desv_A)
print(max_desv_B)
```
39
64
```python
#Histograma de la posicion 39
plt.hist(densidad_DF_A[39], bins=10)
plt.xlabel('x=39')
plt.title('Máxima desviación estandar A')
#plt.ylabel("x=100")
plt.show()
```
![png](CoNGA_files/CoNGA_11_0.png)
```python
#Histograma de la posicion 64
plt.hist(densidad_DF_B[64], bins=10)
plt.xlabel('x=64')
plt.title('Máxima desviación estandar B')
#plt.ylabel("x=100")
plt.show()
```
![png](CoNGA_files/CoNGA_12_0.png)
```python
fig=plt.figure()
plt.plot(X,prom_densidad_ListaA,c='b')
plt.plot(X,prom_densidad_ListaB,c='r')
plt.xticks(np.arange(X[0], X[-1] + 10, step=10))
#plt.text(min(X),0.05,'semilla '+str(semilla),fontsize=10)
plt.legend(['Particulas A', 'Particulas B'],loc='upper right',bbox_to_anchor=(1.35, 1))
plt.xlabel('x')
plt.ylabel('Perfil de densidad')
plt.scatter(X[39], prom_densidad_ListaA[39], c='black')
plt.scatter(X[64], prom_densidad_ListaB[64], c='black')
plt.show()
```
![png](CoNGA_files/CoNGA_13_0.png)
```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