Model

class openfts.model.ChiAB(Nref=None, bref=None, init_fields=None, C=None, rho0=None, B=None, u0=None, chiN=None, chi=None, inverse_zetaN=None, zeta=None, inverse_BC=None)

Chi AB Model

Parameters:
  • Nref (float) – Reference degree of polymerization

  • bref (float) – Reference statistical segment length

  • init_fields (InitField object) – Describes how to initialize fields within model. See InitField

  • C (float) – System density C=ρ0Rg3/Nref. Only one can be specified. Default: C=1.

  • rho0 (float) – System density C=ρ0Rg3/Nref. Only one can be specified. Default: C=1.

  • chiN (float) – Flory-Huggins χ parameter, optionally multiplied Nref. Only one can be specified.

  • chi (float) – Flory-Huggins χ parameter, optionally multiplied Nref. Only one can be specified.

  • inverse_zetaN (float) – Helfand compressibility parameter ζ, optionally multiplied Nref and inverted (i.e. (ζN)1). Only one can be specified. Default: inverse_zetaN=0 (incompressible).

  • zeta (float) – Helfand compressibility parameter ζ, optionally multiplied Nref and inverted (i.e. (ζN)1). Only one can be specified. Default: inverse_zetaN=0 (incompressible).

  • inverse_BC (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

  • B (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

  • u0 (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

Note

Only one compressibility parameter (i.e. u0, B, zeta, inverse_zetaN or inverse_BC) can be specified.

Example (python)

import openfts
fts = openfts.OpenFTS()
...
fts.model = openfts.model.ChiAB(Nref=1.0,bref=1.0,chiN=20.)
...

Example (json)

"model": {
  "type": "ChiAB"
  "Nref": 1.0,
  "bref": 1.0,
  "chiN": 20 ,
  "initfields": {
    ... see "Initialize Model Fields" ...
  },
},

Formally, ModelChiAB is defined by

Z=Dw+DwexpH[w+,w]

where the form of H[w+,w] depends on the compressibility constraint.

  • Incompressible (inverse_BC = 0 or inverse_zetaN=0):

    This model is a smeared version of Model C/E given in Fredrickson 2006.

H[μ+,μ]=Cdxx[1χNμ2μ+]CV~p=1PϕpαplnQp[ΓμA,ΓμB].

where wA=iw+w and wB=iw++w. where μA=μ+μ and μB=μ++μ.

  • Helfand compressibility (inverse_zetaN != 0):

    This model is given in Delaney 2016 Eq 15.

H[μ+,μ]=CχN+2ζNdxx(μ+2+2ζNμ+)+fracCχNdxx(μ2)CV~p=1PϕpαplnQp[ΓμA,ΓμB]
H[μ+,μ]=CχN+2BCdxx(μ+2)+CχNdxx(μ2)CV~p=1PϕpαplnQp[ΓμA,ΓμB]

For discrete chains, this model can be mapped exactly to a particle based model with nonbonded potential

βunb(r)={βu0ψ(r) if AA or BB(βu0+χρ0)ψ(r) if AB

where

ψ(r)=1(8π3/2a3)exp[r2/4a2]
class openfts.model.ChiMultiSpecies(Nref=None, bref=None, init_fields=None, C=None, rho0=None, B=None, u0=None, inverse_zetaN=None, zeta=None, inverse_BC=None, chiN_array=None, chi_array=None, chiN_diagonal=None, chi_diagonal=None)

Chi Multi-Species Model

Parameters:
  • Nref (float) – Reference degree of polymerization

  • bref (float) – Reference statistical segment length

  • init_fields (InitField object) – Describes how to initialize fields within model. See InitField

  • C (float) – System density C=ρ0Rg3/Nref. Only one can be specified. Default: C=1.

  • rho0 (float) – System density C=ρ0Rg3/Nref. Only one can be specified. Default: C=1.

  • inverse_zetaN (float) – Helfand compressibility parameter ζ, optionally multiplied Nref and inverted (i.e. (ζN)1). Only one can be specified. Default: inverse_zetaN=0 (incompressible).

  • zeta (float) – Helfand compressibility parameter ζ, optionally multiplied Nref and inverted (i.e. (ζN)1). Only one can be specified. Default: inverse_zetaN=0 (incompressible).

  • inverse_BC (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

  • B (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

  • u0 (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

  • chiN_array (float array) – Flory-Huggins χ parameters, optionally multiplied Nref. Ordering of array elements are χ1,χ2,χ3,... and correspond to the upper diagonal of the χχ interaction matrix.

  • chi_array (float array) – Flory-Huggins χ parameters, optionally multiplied Nref. Ordering of array elements are χ1,χ2,χ3,... and correspond to the upper diagonal of the χχ interaction matrix.

  • chiN_diagonal (float array) – Flory-Huggins χiis self interaction parameters, optionally multiplied Nref. This can be used to make some species more or less compressible than others. Length of array should be equal to number of species and corresponds to the diagonal elements of the χχ interaction matrix. Ordering of elements are χ11s,χ22s,χ33s,...

  • chi_diagonal (float array) – Flory-Huggins χiis self interaction parameters, optionally multiplied Nref. This can be used to make some species more or less compressible than others. Length of array should be equal to number of species and corresponds to the diagonal elements of the χχ interaction matrix. Ordering of elements are χ11s,χ22s,χ33s,...

Note

Only one compressibility parameter (i.e. u0, B, zeta, inverse_zetaN or inverse_BC) can be specified.

For a 3 species model:

χχ=(χ11sχ1χ2χ1χ22sχ3χ2χ3χ33s)

For a 4 species model:

χχ=(χ11sχ1χ2χ3χ1χ22sχ4χ5χ2χ4χ33sχ6χ3χ5χ6χ44s)

Example (python)

chiN = 30.0
fts.model = openfts.model.ChiMultiSpecies(Nref=1.0,bref=1.0,inverse_zetaN=0.01,chiN_array=[chiN, chiN, chiN])

...

# to initialize EXCHANGE fields
fts.model.init_fields['mu_1'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
fts.model.init_fields['mu_2'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
fts.model.init_fields['mu_3'] = openfts.init_field.Random(mean=0.0,stdev=1.0)

# to initialize SPECIES fields
fts.model.init_fields['mu_A'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
fts.model.init_fields['mu_B'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
fts.model.init_fields['mu_C'] = openfts.init_field.Random(mean=0.0,stdev=1.0)

...

# three species must be present
fts.species.append(openfts.Species(label='A',stat_segment_length=1.0))
fts.species.append(openfts.Species(label='B',stat_segment_length=1.0))
fts.species.append(openfts.Species(label='C',stat_segment_length=1.0))

Example (json)

"model": {
  "type": "ChiMultiSpecies"
      "Nref": 1.0,
      "bref": 1.0,
      "chiN_array": [20,40,20] ,
      "initfields": {
    ... see "Initialize Model Fields" ...
  },
},

The formal definition of ModelChiMultiSpecies depends on the compressibility constraint.

  • Incompressible (inverse_BC = 0 or inverse_zetaN=0):

    This model is given in Duchs 2014 Eq 6-7 and Appendix A.

  • Helfand compressibility (inverse_zetaN != 0):

    This model is given in Duchs 2014 Eq 25-26 and Appendix B.

  • Excluded volume compressibility (inverse_BC != 0):

    This model is given in Lequieu 2024 Eq 9-10 (with varphi = 0)

    For discrete chains, this model can be mapped exactly to a particle based model with nonbonded potential

    βunb(r)=βuij8π3/2aij3exp(r24aij2)

    where

    βuij=βu0+χij/ρ0
class openfts.model.ChiMultiSpeciesCharge(Nref=None, bref=None, init_fields=None, C=None, rho0=None, B=None, u0=None, inverse_zetaN=None, zeta=None, inverse_BC=None, chiN_array=None, chi_array=None, chiN_diagonal=None, chi_diagonal=None, E=None, lB=None)

Chi Multi-Species Charge Model

Parameters:
  • Nref (float) – Reference degree of polymerization

  • bref (float) – Reference statistical segment length

  • init_fields (InitField object) – Describes how to initialize fields within model. See InitField

  • C (float) – System density C=ρ0Rg3/Nref. Only one can be specified. Default: C=1.

  • rho0 (float) – System density C=ρ0Rg3/Nref. Only one can be specified. Default: C=1.

  • inverse_zetaN (float) – Helfand compressibility parameter ζ, optionally multiplied Nref and inverted (i.e. (ζN)1). Only one can be specified. Default: inverse_zetaN=0 (incompressible).

  • zeta (float) – Helfand compressibility parameter ζ, optionally multiplied Nref and inverted (i.e. (ζN)1). Only one can be specified. Default: inverse_zetaN=0 (incompressible).

  • inverse_BC (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

  • B (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

  • u0 (float) – Excluded volume incompressiblity. B=βu0N2/Rg3 is the dimensionless excluded volume and C=nRg3/V. See Delaney2016 for details.

  • chiN_array (float array) – Flory-Huggins χ parameters, optionally multiplied Nref. Ordering of array elements are χ1,χ2,χ3,... and correspond to the upper diagonal of the χχ interaction matrix.

  • chi_array (float array) – Flory-Huggins χ parameters, optionally multiplied Nref. Ordering of array elements are χ1,χ2,χ3,... and correspond to the upper diagonal of the χχ interaction matrix.

  • chiN_diagonal (float array) – Flory-Huggins χiis self interaction parameters, optionally multiplied Nref. This can be used to make some species more or less compressible than others. Length of array should be equal to number of species and corresponds to the diagonal elements of the χχ interaction matrix. Ordering of elements are χ11s,χ22s,χ33s,...

  • chi_diagonal (float array) – Flory-Huggins χiis self interaction parameters, optionally multiplied Nref. This can be used to make some species more or less compressible than others. Length of array should be equal to number of species and corresponds to the diagonal elements of the χχ interaction matrix. Ordering of elements are χ11s,χ22s,χ33s,...

  • E (float) – Electrostatic interaction strength. Only one can be specified.

  • lB (float) – Electrostatic interaction strength. Only one can be specified.

Note

Only one compressibility parameter (i.e. u0, B, zeta, inverse_zetaN or inverse_BC) can be specified.

For a 3 species model:

χχ=(χ11sχ1χ2χ1χ22sχ3χ2χ3χ33s)

For a 4 species model:

χχ=(χ11sχ1χ2χ3χ1χ22sχ4χ5χ2χ4χ33sχ6χ3χ5χ6χ44s)

Example (python)

chiN = 30.0
fts.model = openfts.model.ChiMultiSpeciesCharge(Nref=1.0,bref=1.0,inverse_zetaN=0.01,chiN_array=[chiN, chiN, chiN],E=1000)

...

# to initialize EXCHANGE fields
fts.model.init_fields['mu_1'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
fts.model.init_fields['mu_2'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
fts.model.init_fields['mu_3'] = openfts.init_field.Random(mean=0.0,stdev=1.0)

# to initialize SPECIES fields
fts.model.init_fields['mu_A'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
fts.model.init_fields['mu_B'] = openfts.init_field.Random(mean=0.0,stdev=1.0)
fts.model.init_fields['mu_C'] = openfts.init_field.Random(mean=0.0,stdev=1.0)

...

# three species must be present
fts.species.append(openfts.Species(label='A',stat_segment_length=1.0, charge=+1))
fts.species.append(openfts.Species(label='B',stat_segment_length=1.0, charge=0))
fts.species.append(openfts.Species(label='C',stat_segment_length=1.0, charge=-1))

Example (json)

"model": {
  "type": "ChiMultiSpeciesCharge"
  "Nref": 1.0,
  "bref": 1.0,
  "E":1000,
  "chiN_array": [20,40,20] ,
  "initfields": {
    ... see "Initialize Model Fields" ...
  },
},

The formal definition of ModelChiMultiSpecies depends on the compressibility constraint.

  • Incompressible (inverse_BC = 0 or inverse_zetaN=0):

    This model is given in Duchs 2014 Eq 6-7 and Appendix A plus an electrostatic φ field.

  • Helfand compressibility (inverse_zetaN != 0):

    This model is given in Duchs 2014 Eq 25-26 and Appendix B plus an electrostatic φ field.

  • Excluded volume compressibility (inverse_BC != 0):

    This model is given in Lequieu 2024 Eq 9-10.

    For discrete chains, this model can be mapped exactly to a particle based model with nonbonded potential (see Lequieu 2024 Eq 3):

    βunb(r)=βuij8π3/2aij3exp(r24aij2)+lBzizjr erf(r2aij)

    where lB is the Bjerrum length, aij=((ai2+aj2)/2)1/2 and βuij=βu0+χij/ρ0.

class openfts.model.Edwards(Nref=None, bref=None, init_fields=None, C=None, rho0=None, B=None, u0=None)

Edwards Model

Parameters:
  • Nref (float) – Reference degree of polymerization

  • bref (float) – Reference statistical segment length

  • init_fields (InitField object) – Describes how to initialize fields within model. See InitField

  • C (float) – System density C=ρ0Rg3/Nref. Only one can be specified.

  • rho0 (float) – System density C=ρ0Rg3/Nref. Only one can be specified.

  • B (float) – Excluded volume parameter B=u0Nref2/Rg3. Only one can be specified.

  • u0 (float) – Excluded volume parameter B=u0Nref2/Rg3. Only one can be specified.

Example (python):

fts.model = openfts.model.Edwards(Nref=1.0,bref=1.0,C=4.0,B=2.0)

Example (json):

"model": {
  "Nref": 1.0,
  "bref": 1.0,
  "C": 4.0,
  "B": 2.0,
  "initfields": {
    "mu": {
      "type": "random",
      "mean": 1.0,
      "stdev": 0.1
    }
  },
  "type": "Edwards"
},


"model": {
  "type": "Edwards",
  "Nref": 1.0,
  "bref": 1.0,
  "nu0": 30,
  "rho0": 10,
  "initfields": {
      "mu": {
      "seed": 0,
      "type": "random"
    }
  }
},

Formally, ModelEdwards is defined by (see Villet 2014)

Z=Z0Dwexp(H[w])

where

H[w]=12νdrr[w(rr)]2pPnplnQp[iΓw]

For discrete chains, this model can be mapped exactly to a particle based model with nonbonded potential

βunb(r)=βu08π3/2a3exp(r24a2)
class openfts.model.EdwardsCharge(Nref=None, bref=None, init_fields=None, C=None, rho0=None, B=None, u0=None, charge_ref=None, E=None, lB=None)

Edwards Charge Model

Parameters:
  • Nref (float) – Reference degree of polymerization

  • bref (float) – Reference statistical segment length

  • init_fields (InitField object)

  • charge_ref (float) – Reference charge density

  • B (float) – Excluded volume parameter B=u0Nref2/Rg3. Only one can be specified.

  • u0 (float) – Excluded volume parameter B=u0Nref2/Rg3. Only one can be specified.

  • C (float) – System density C=ρ0Rg3/Nref. Only one can be specified.

  • rho0 (float) – System density C=ρ0Rg3/Nref. Only one can be specified.

  • E (float) – Electrostatic interaction strength. Only one can be specified.

  • lB (float) – Electrostatic interaction strength. Only one can be specified.

Example (python):

import openfts
fts = openfts.OpenFTS()
...
fts.model = openfts.model.EdwardsCharge(Nref=1.0,bref=1.0,charge_ref=1.0, C=6.0,B=0.3,E=64000.0)
...

Example (json)

"model": {
  "B": 0.3,
  "C": 6.0,
  "E": 64000.0,
  "Nref": 1.0,
  "bref": 1.0,
  "charge_ref": 1.0,
  "initfields": {
    "mu": {
      "mean": 1.0, "stdev": 0.1, "type": "random"
    },
    "phi": {
      "mean": 1.0, "stdev": 0.1, "type": "random"
    }
  },
  "type": "EdwardsCharge"
},

Formally, ModelEdwardsCharge is defined by (see Delaney 2017, Riggleman 2012, Lee 2008)

Z=Z0ZwZφDwDφexp(H[w,φ])

where

H[w]=1Bdrr[w(rr)]2+12EV~d3r|φ|2pPnplnQp[iΓw]

For discrete chains, this model can be mapped exactly to a particle based model with nonbonded potential

βunb(r)=βu08π3/2aij3exp(r24aij2)+lBzizjr erf(r2aij)

.