Commit 6bcfa381 by Luuk Balkenende

### Added all function descriptions to functions

parent 338f704b
 # Import libaries/functions import numpy as np from matplotlib import pyplot as plt import random from functions_perm import calc_pol, allocate, init, perm, add_bead, limits, prune, enrich, maxsize, stack_init, exp_calc from simfunctions import calc_pol, allocate, init, perm, add_bead, limits, prune, enrich from processfunctions import exp_calc, bootstrap # Simulation parameters n_beads = 100 # number of beads n_beads = 250 # number of beads n = 6 # number of angles n_pol = 500 # number of polymers n_pol = 300 # number of polymers alfa_up = 2 # alfa to compute upper limit alfa_low = 1 # alfa to compute lwoer limit cst_dep = 1 / (0.75 * n) # multiplication constant for L dependence perm alfa_low = 0.7 # alfa to compute lower limit PERM = False # boolean random_walk = False # boolean # Physical parameters T_dim = 100 # T * (Kb / eps) # Non-dimensional temperature # Choose algorithm PERM = True # Put on True if PERM algorithm is desired random_walk = False # Put on True if random walk is desired # Calculate configuration of polymers and their weights end_end_array, polweight_array = calc_pol(n_beads, n, n_pol, alfa_low, alfa_up, cst_dep, T_dim, PERM, random_walk) # Physical parameters T_dim = 10 # T * (Kb / eps) # Non-dimensional temperature exp_value = exp_calc(polweight_array, end_end_array) a = np.arange(2, n_beads - 1, 1) # Simulate configuration of polymers and their weights end_end_array, polweight_array = calc_pol(n_beads, n, n_pol, alfa_low, alfa_up, T_dim, PERM, random_walk) plt.figure() plt.loglog(a, exp_value[2:n_beads - 1] ** 2, marker="x", markersize=7, color="k") plt.ylabel('R^2 (end to end distance)') plt.xlabel('N (Number of beads)') plt.grid(True, which="both", ls="-") plt.ylim(1, 10000) plt.xlim(1, 250) plt.show() \ No newline at end of file # Process configuration of polymers and their weights into figures (end2end distance against n_beads) # and preform bootstrap to calculate errors. exp_calc(polweight_array, end_end_array, n_beads)