# Path: dnacc/units.py
# _GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS = 1.660538782e-27  # kg
# _GSL_CONST_MKSA_ELECTRON_CHARGE = 1.602176487e-19  # A s
# _GSL_CONST_NUM_AVOGADRO = 6.02214199e23  # 1 / mol
# _GSL_CONST_MKSA_GAUSS = 1e-4  # kg / A s^2
# _GSL_CONST_MKSA_BAR = 1e5  # kg / m s^2
# _GSL_CONST_MKSA_STD_ATMOSPHERE = 1.01325e5  # kg / m s^2
# _GSL_CONST_MKSA_TORR = 1.33322368421e2  # kg / m s^2
# _GSL_CONST_MKSA_METER_OF_MERCURY = 1.33322368421e5  # kg / m s^2
# K = 1.0
#     A = Ampere
# N = kg * m / s ** 2
# J = N * m
# W = J / s
# C = Ampere * s
# V = J / C
# F = C / V
# S = 1 / Ohm
# T = Wb / m ** 2
# H = Wb / Ampere
# L = dm ** 3
# G = _GSL_CONST_MKSA_GAUSS * T
# P = 1 * g / (cm * s)
# AA = 1e-10 * m
# M = mol / L
# def add_amperes_unit():
# def _add_prefixes(name, realname=None):
# 
# Path: dnacc/physics.py
# _GSL_CONST_MKSA_SPEED_OF_LIGHT = 2.99792458e8  # m / s
# _GSL_CONST_MKSA_VACUUM_PERMITTIVITY = 8.854187817e-12  # A^2 s^4 / kg m^3
# _GSL_CONST_MKSA_VACUUM_PERMEABILITY = 1.25663706144e-6  # kg m / A^2 s^2
# _GSL_CONST_NUM_AVOGADRO = 6.02214199e23  # 1 / mol
# _GSL_CONST_MKSA_BOLTZMANN = 1.3806504e-23  # kg m^2 / K s^2
# _GSL_CONST_MKSA_MOLAR_GAS = 8.314472e0  # kg m^2 / K mol s^2
# _GSL_CONST_MKSA_ELECTRON_CHARGE = 1.602176487e-19  # A s
# _GSL_CONST_MKSA_ELECTRON_VOLT = 1.602176487e-19  # kg m^2 / s^2
# _GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS = 1.660538782e-27  # kg
# _GSL_CONST_MKSA_MASS_ELECTRON = 9.10938188e-31  # kg
# _GSL_CONST_MKSA_BOHR_RADIUS = 5.291772083e-11  # m
# _GSL_CONST_MKSA_DEBYE = 3.33564095198e-30  # A s^2 / m^2
# N_A = _GSL_CONST_NUM_AVOGADRO
# R = _GSL_CONST_MKSA_MOLAR_GAS * units.J / (units.K * units.mol)
# D = _GSL_CONST_MKSA_DEBYE * units.C * units.m
# 
# Path: dnacc/units.py
# _GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS = 1.660538782e-27  # kg
# _GSL_CONST_MKSA_ELECTRON_CHARGE = 1.602176487e-19  # A s
# _GSL_CONST_NUM_AVOGADRO = 6.02214199e23  # 1 / mol
# _GSL_CONST_MKSA_GAUSS = 1e-4  # kg / A s^2
# _GSL_CONST_MKSA_BAR = 1e5  # kg / m s^2
# _GSL_CONST_MKSA_STD_ATMOSPHERE = 1.01325e5  # kg / m s^2
# _GSL_CONST_MKSA_TORR = 1.33322368421e2  # kg / m s^2
# _GSL_CONST_MKSA_METER_OF_MERCURY = 1.33322368421e5  # kg / m s^2
# K = 1.0
#     A = Ampere
# N = kg * m / s ** 2
# J = N * m
# W = J / s
# C = Ampere * s
# V = J / C
# F = C / V
# S = 1 / Ohm
# T = Wb / m ** 2
# H = Wb / Ampere
# L = dm ** 3
# G = _GSL_CONST_MKSA_GAUSS * T
# P = 1 * g / (cm * s)
# AA = 1e-10 * m
# M = mol / L
# def add_amperes_unit():
# def _add_prefixes(name, realname=None):
# 
# Path: dnacc/utils.py
# def pbc_delta(x1, x2, Lx):
#     """Find x1 - x2 in a periodic 1D interval of size Lx."""
#     dx = (x1 - x2) % Lx
#     if dx > 0.5 * Lx:
#         dx -= Lx
#     return dx


import dnacc
import numpy as np
import subprocess
import os
from dnacc import units, physics
from dnacc.units import nm
from dnacc.utils import pbc_delta
from ssDNA_stats import *
from math import pi, sqrt, acos, cos, atan2, log, exp
from contextlib import contextmanager
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

#!/usr/bin/env python




try:
    os.mkdir('results')
except Exception:
    pass

# ========================================================================
# Parameters
# ========================================================================

# Everything that Bortolo has calculated uses Kuhn lengths as the unit
# of length

# Path: dnacc/units.py
# _GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS = 1.660538782e-27  # kg
# _GSL_CONST_MKSA_ELECTRON_CHARGE = 1.602176487e-19  # A s
# _GSL_CONST_NUM_AVOGADRO = 6.02214199e23  # 1 / mol
# _GSL_CONST_MKSA_GAUSS = 1e-4  # kg / A s^2
# _GSL_CONST_MKSA_BAR = 1e5  # kg / m s^2
# _GSL_CONST_MKSA_STD_ATMOSPHERE = 1.01325e5  # kg / m s^2
# _GSL_CONST_MKSA_TORR = 1.33322368421e2  # kg / m s^2
# _GSL_CONST_MKSA_METER_OF_MERCURY = 1.33322368421e5  # kg / m s^2
# K = 1.0
#     A = Ampere
# N = kg * m / s ** 2
# J = N * m
# W = J / s
# C = Ampere * s
# V = J / C
# F = C / V
# S = 1 / Ohm
# T = Wb / m ** 2
# H = Wb / Ampere
# L = dm ** 3
# G = _GSL_CONST_MKSA_GAUSS * T
# P = 1 * g / (cm * s)
# AA = 1e-10 * m
# M = mol / L
# def add_amperes_unit():
# def _add_prefixes(name, realname=None):
# 
# Path: dnacc/physics.py
# _GSL_CONST_MKSA_SPEED_OF_LIGHT = 2.99792458e8  # m / s
# _GSL_CONST_MKSA_VACUUM_PERMITTIVITY = 8.854187817e-12  # A^2 s^4 / kg m^3
# _GSL_CONST_MKSA_VACUUM_PERMEABILITY = 1.25663706144e-6  # kg m / A^2 s^2
# _GSL_CONST_NUM_AVOGADRO = 6.02214199e23  # 1 / mol
# _GSL_CONST_MKSA_BOLTZMANN = 1.3806504e-23  # kg m^2 / K s^2
# _GSL_CONST_MKSA_MOLAR_GAS = 8.314472e0  # kg m^2 / K mol s^2
# _GSL_CONST_MKSA_ELECTRON_CHARGE = 1.602176487e-19  # A s
# _GSL_CONST_MKSA_ELECTRON_VOLT = 1.602176487e-19  # kg m^2 / s^2
# _GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS = 1.660538782e-27  # kg
# _GSL_CONST_MKSA_MASS_ELECTRON = 9.10938188e-31  # kg
# _GSL_CONST_MKSA_BOHR_RADIUS = 5.291772083e-11  # m
# _GSL_CONST_MKSA_DEBYE = 3.33564095198e-30  # A s^2 / m^2
# N_A = _GSL_CONST_NUM_AVOGADRO
# R = _GSL_CONST_MKSA_MOLAR_GAS * units.J / (units.K * units.mol)
# D = _GSL_CONST_MKSA_DEBYE * units.C * units.m
# 
# Path: dnacc/units.py
# _GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS = 1.660538782e-27  # kg
# _GSL_CONST_MKSA_ELECTRON_CHARGE = 1.602176487e-19  # A s
# _GSL_CONST_NUM_AVOGADRO = 6.02214199e23  # 1 / mol
# _GSL_CONST_MKSA_GAUSS = 1e-4  # kg / A s^2
# _GSL_CONST_MKSA_BAR = 1e5  # kg / m s^2
# _GSL_CONST_MKSA_STD_ATMOSPHERE = 1.01325e5  # kg / m s^2
# _GSL_CONST_MKSA_TORR = 1.33322368421e2  # kg / m s^2
# _GSL_CONST_MKSA_METER_OF_MERCURY = 1.33322368421e5  # kg / m s^2
# K = 1.0
#     A = Ampere
# N = kg * m / s ** 2
# J = N * m
# W = J / s
# C = Ampere * s
# V = J / C
# F = C / V
# S = 1 / Ohm
# T = Wb / m ** 2
# H = Wb / Ampere
# L = dm ** 3
# G = _GSL_CONST_MKSA_GAUSS * T
# P = 1 * g / (cm * s)
# AA = 1e-10 * m
# M = mol / L
# def add_amperes_unit():
# def _add_prefixes(name, realname=None):
# 
# Path: dnacc/utils.py
# def pbc_delta(x1, x2, Lx):
#     """Find x1 - x2 in a periodic 1D interval of size Lx."""
#     dx = (x1 - x2) % Lx
#     if dx > 0.5 * Lx:
#         dx -= Lx
#     return dx


# Path: examples/rogers_crocker_spheres/rogers_crocker_spheres.py
import dnacc
import numpy as np
import subprocess
import os
from dnacc import units, physics
from dnacc.units import nm
from dnacc.utils import pbc_delta
from ssDNA_stats import *
from math import pi, sqrt, acos, cos, atan2, log, exp
from contextlib import contextmanager

#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

#!/usr/bin/env python




try:
    os.mkdir('results')
except Exception:
    pass

# ========================================================================
# Parameters
# ========================================================================

# Everything that Bortolo has calculated uses Kuhn lengths as the unit
# of length

l_Kuhn = 5 * nm