You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							51 lines
						
					
					
						
							1.3 KiB
						
					
					
				
			
		
		
	
	
							51 lines
						
					
					
						
							1.3 KiB
						
					
					
				| '''
 | |
| Calculo de bending y stretching sobre datos en una circunferencia (se asume equiespaciamiento angular)
 | |
| Ultima Fecha Modificacion: 30/03/25
 | |
| '''
 | |
| 
 | |
| # %% LIBRERIAS
 | |
| 
 | |
| import numpy as np
 | |
| import matplotlib.pyplot as plt
 | |
| import Codigo2D_Base as c7
 | |
| import Codigo2D_AjusteHelfrich as c8
 | |
| 
 | |
| # %% FUNCION TEORICA
 | |
| 
 | |
| kb = 1.380649*10**-23
 | |
| T = 300
 | |
| kbT = kb*T
 | |
| 
 | |
| valor = 10*kbT # este es el valor que deberia tener el bending
 | |
| 
 | |
| def fx(x,stretch,bend):
 | |
|     y = kbT*(0.5/stretch)*((1/x) - (stretch/bend + x**2)**(-0.5))
 | |
|     return y
 | |
| 
 | |
| # %% CODIGO 
 | |
| 
 | |
| def calculatecoefs(MSph, nmin, nmax):
 | |
|     
 | |
|     '''
 | |
|     Se utiliza el metodo de trapecios
 | |
|     '''
 | |
|     
 | |
|     qx,u = c7.f2(MSph,21,positive = "Yes") # TODOS LOS COEFICIENTES (U) del 1 al 20
 | |
|     
 | |
|     '''
 | |
|     El bending solo se calcula para ciertos modos
 | |
|     '''
 | |
|     
 | |
|     qxnew = qx[nmin:nmax]
 | |
|     unew = u[nmin:nmax]
 | |
|     
 | |
|     bend,stretch = c8.aproxHelfrich(qxnew,unew)
 | |
|     qxcont = np.linspace(qxnew[0],qxnew[-1],100) # limites coinciden con qx, pero Y no tiene porque es un ajuste no hay restriccion
 | |
|     Ycont = fx(qxcont,stretch,bend)  # Al representar sera en el eje x: qxnew y en el y: Y
 | |
|     
 | |
|     print("----------------")
 | |
|     print(f"Para modos entre {nmin+1} y {nmax+1} se obtiene:")
 | |
|     print("Bending (en uds kbT): ",bend/kbT)
 | |
|     print("Stretching [N/m]: ",stretch)
 | |
|     
 | |
|     return qx,u,qxcont,Ycont,bend,stretch |