예제 #1
0
  #related to the 'jump' (discontinuity) at r = sigma
  
  doLennardJonesExample = False
  
  if doLennardJonesExample:
      #LJ possible but with HMSA
      solver.setPotentialByName('LennardJones', 0.1) #epsilon/kT = 0.1 is default in SASfit
      print "Energy scale of Lennard Jones Potential in kT units:", solver.getEpsilonInkTUnits()
      #Initialize HMSA with some (random) start alpha
      solver.doHMSAclosure(1.0)
  
  else:
      #Yukawa possible with RY: With negative K (attractive besides HS) convergence may be reached for exp shift only (real HS-Yukawa)
      #positive (repulsive as HS) K converges for fully shifted potential (1/r included)
      solver.setPotentialByName('Yukawa', 1.0, -1.0, True) #lamda in SASfit is different; K = 0.1 is default in SASfit
      print "Energy scale of Yukawa HS Potential in kT units:", solver.getInteractionStrengthInKTunits()
      print "Length scale of Yukawa HS Potential in sigma units:", solver.getShieldingConstantInSigmaUnits()
      #Initialize RY with some (random) start alpha
      solver.doRYclosure(1.0)

  
  solver.setVolumeDensity(0.3)
  print "Volume density of liquid:", solver.getVolumeDensity()
  
  print "start solving for optimal closure alpha...."
  
  #Should we minimize cost functional or find a root?
  doUseMinimizer = False
  doSearchIndependentPlot = False
  #Save iterated points in alpha space as dict to plot later
  finderFunctionGraph = {}
예제 #2
0
    if doLennardJonesExample:
        #LJ possible but with HMSA
        solver.setPotentialByName('LennardJones',
                                  0.1)  #epsilon/kT = 0.1 is default in SASfit
        print "Energy scale of Lennard Jones Potential in kT units:", solver.getEpsilonInkTUnits(
        )
        #Initialize HMSA with some (random) start alpha
        solver.doHMSAclosure(1.0)

    else:
        #Yukawa possible with RY: With negative K (attractive besides HS) convergence may be reached for exp shift only (real HS-Yukawa)
        #positive (repulsive as HS) K converges for fully shifted potential (1/r included)
        solver.setPotentialByName(
            'Yukawa', 1.0, -1.0,
            True)  #lamda in SASfit is different; K = 0.1 is default in SASfit
        print "Energy scale of Yukawa HS Potential in kT units:", solver.getInteractionStrengthInKTunits(
        )
        print "Length scale of Yukawa HS Potential in sigma units:", solver.getShieldingConstantInSigmaUnits(
        )
        #Initialize RY with some (random) start alpha
        solver.doRYclosure(1.0)

    solver.setVolumeDensity(0.3)
    print "Volume density of liquid:", solver.getVolumeDensity()

    print "start solving for optimal closure alpha...."

    #Should we minimize cost functional or find a root?
    doUseMinimizer = False
    doSearchIndependentPlot = False
    #Save iterated points in alpha space as dict to plot later
    finderFunctionGraph = {}