This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from signac_dashboard import Dashboard | |
from signac_dashboard.modules import StatepointList, ImageViewer, VideoViewer | |
from signac_dashboard.modules import Notes | |
class PlotDashboard(Dashboard): | |
def job_sorter(self, job): | |
return [job.sp.pressure, job.sp.kT] | |
def job_title(self, job): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# how to wrap a single coordinate | |
x_wrapped = (x - box.mins[0]) % box.lenghts[0] + box.mins[0] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rotacf(x, y, funlen, dstart=2): | |
"""Calculate the autocorrelation of a function | |
Params | |
------ | |
forces : np.ndarray, shape=(n,) | |
The force timeseries acting on a molecules | |
timestep : float | |
Simulation timestep in fs | |
funlen : int | |
The desired length of the correlation function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
system = hoomd.deprecated.init.create_random_polymers( | |
box=hoomd.data.boxdim(L=60), | |
polymers=[polymer1], | |
separation=dict(A=0.25, B=0.25), seed=52) | |
charges = {'A': -1, 'B': 1} | |
for p in system.particles: | |
p.charge = charges[p.type] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import curve fit | |
from scipy.optimize import curve_fit | |
# this is the function you want to fit to | |
def gauss(r, *p): | |
A, sigma, r0 = p | |
return A / (sigma * (np.pi/2)**0.5) * np.exp(-2*(r - r0)**2/sigma**2) | |
# p0 = initial guesstes | |
p0 = (np.amax(hist), (bins[-1]-bins[0])/2, bins[np.argmax(hist)]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy import pi | |
import mbuild as mb | |
cer2 = mb.load('cer2.pdb') | |
grid = mb.pattern.Grid2DPattern(50, 50) | |
leaflet, system = mb.Compound(), mb.Compound() | |
repeat_spacing = 6 # repeat spacing in nm | |
leaflet = grid.apply(cer2) # put lipids on gird points | |
leaflet = mb.Compound(leaflet) | |
for layer_num in range(4): # add 4 leaflets to the system |
NewerOlder