parent
129375d321
commit
565c77213c
@ -1,40 +1,29 @@ |
|||||||
|
|
||||||
import numpy as np |
import numpy as np |
||||||
import matplotlib.pyplot as plt |
import matplotlib.pyplot as plt |
||||||
from scipy.optimize import curve_fit |
from scipy.optimize import curve_fit |
||||||
|
|
||||||
kb = 1.380649e-23 # Constante de Boltzmann |
kb = 1.380649e-23 # Constante de Boltzmann |
||||||
T = 300 # Temperatura en Kelvin |
|
||||||
kbT = kb * T # Factor kb * T |
|
||||||
|
|
||||||
def helfrich_model(x, bend, stretch): |
def helfrich_model(x, bend, stretch, kbT): |
||||||
|
|
||||||
bend = abs(bend) |
bend = abs(bend) |
||||||
stretch = abs(stretch) |
stretch = abs(stretch) |
||||||
|
term = stretch / bend + x**2 |
||||||
term = stretch / bend + x**2 |
|
||||||
|
|
||||||
result = kbT * (0.5 / stretch) * ((1 / x) - term ** -0.5) |
result = kbT * (0.5 / stretch) * ((1 / x) - term ** -0.5) |
||||||
return result |
return result |
||||||
|
|
||||||
def aproxHelfrich(x, y): |
|
||||||
|
def aproxHelfrich(x, y, T): |
||||||
x = np.array(x) |
x = np.array(x) |
||||||
y = np.array(y) |
y = np.array(y) |
||||||
|
kbT = kb * T |
||||||
|
|
||||||
try: |
def model_fixedT(x, bend, stretch): |
||||||
|
return helfrich_model(x, bend, stretch, kbT) |
||||||
|
|
||||||
popt, _ = curve_fit(helfrich_model, x, y, p0=[1.4e-19, 1e-7]) # valores referencia |
try: |
||||||
|
popt, _ = curve_fit(model_fixedT, x, y, p0=[1.4e-19, 1e-7]) |
||||||
bend, stretch = popt |
bend, stretch = popt |
||||||
|
return abs(bend), abs(stretch) |
||||||
# Aseguramos que bend y stretch sean siempre positivos |
|
||||||
bend = abs(bend) |
|
||||||
stretch = abs(stretch) |
|
||||||
|
|
||||||
# # Establecemos un límite inferior para el valor de 'bend' |
|
||||||
# bend = max(bend, 1e-20) |
|
||||||
return bend, stretch |
|
||||||
except RuntimeError: |
except RuntimeError: |
||||||
print("Error: La optimización no convergió") |
print("Error: La optimización no convergió") |
||||||
return None, None |
return None, None |
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@ |
|||||||
|
El archivo de las simulaciones usado es "matrizcartesianas.npy" (modificar variando T y xi) |
||||||
|
|
||||||
|
- Los archivos de "..._Ejemplo.py" son los que hay que ejecutar (cambiando el archivo de simulaciones) |
||||||
|
|
||||||
|
- Cuando se varía T de las simulaciones, se tiene que modificar "..._Ejemplo.py" (linea 15 en 3D, linea 12 en 2D) |
||||||
|
|
||||||
|
- En el caso 3D el análisis se hace hasta Lmax = 20, y el análisis posterior se hace entre l = 2 y l = 6 (se puede variar en las líneas 26,30,31) |
||||||
|
|
||||||
|
- En el caso 2D, se realiza el análisis hasta un 1% del radio promedio (en z, linea 29 modificable), y se analiza entre n = 5, y n = 20 (modificable en linea 39,40) |
@ -0,0 +1,25 @@ |
|||||||
|
En estos códigos se realiza el análisis en 2D y 3D de la membrana. |
||||||
|
|
||||||
|
# %% CASO 2D |
||||||
|
|
||||||
|
2D: https://link.springer.com/article/10.1140/epje/i2004-10001-9 (Ajuste a Ec.11) |
||||||
|
|
||||||
|
En el caso 2D se eligen valores cercanos al origen y se proyectan sobre el plano Z = 0 |
||||||
|
|
||||||
|
Se interpolan los datos de forma equiespaciada |
||||||
|
|
||||||
|
Mediante integración por trapecios se obtienes los coeficientes |
||||||
|
|
||||||
|
Se obtienen los valores medios y se ajustan a la ecuación |
||||||
|
|
||||||
|
# %% CASO 3D |
||||||
|
|
||||||
|
3D: https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.106.188101 (Ajuste a Ec.7) |
||||||
|
|
||||||
|
- Proyección sobre grid icosaédrico |
||||||
|
|
||||||
|
- Expansion mediante armónicos esféricos (de variación con respecto a superficie promedio) |
||||||
|
|
||||||
|
- Calculo de valores medios |
||||||
|
|
||||||
|
- Se obtienen los valores medios y se ajustan a la ecuación |
Loading…
Reference in new issue