Commit f3be7eca authored by Laurien's avatar Laurien
Browse files

Created log plot

parent 8a07999f
This diff is collapsed.
......@@ -72,6 +72,14 @@ def upperlowerlimit(alpha1, alpha2, w_lfinal, w_ave, lowlimit, uplimit):
return lowlimit, uplimit
def crossing(i, position):
"""
**** Only used for checks, not implemented in the algorithm ****
function: Makes sure the polymer beads are not allowed to come too close/overlap
input: positions
output: prints "crossing!" if polymer beads come too close
"""
cross = False
dx = np.zeros(shape=(L, L-1))
......@@ -91,7 +99,7 @@ def endtoend(position, maxbead):
return e2e
def calc_mean(obs, weight):
weightedobs = obs * weight
weightedobs = np.multiply(obs, weight)
meanvalue = np.sum(weightedobs, axis=1) / np.sum(weight, axis=1)
return meanvalue
......@@ -105,7 +113,27 @@ def calc_std(obs, weight):
def function(x,a,b):
return a *(x)**(b)
return a * x**b
def enrich(PolWeight, NewWeight):
NewWeight = 0.5 * PolWeight
#print("Weight is halved!")
return NewWeight
def prune(PolWeight, NewWeight):
R=np.random.rand(1)
if(R<0.5):
NewWeight = 2 * PolWeight
return NewWeight
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment