用户工具

站点工具

本页面的其他翻译:
  • zh

adf:cosmorslecturesupple03

补充材料3:Python脚本中修改参数集的方法

1,定义参数所需语句

以下是COSMO-RS方法中ADF Combi 1998参数集的具体参数,其他参数集数值有所不同,类似修改即可。

参数集的数据值,可以在SCM → COSMO-RS → Method → Parameters中看到。如果Method → 选择的是COSMO-RS,则列出COSMO-RS的相关参数集,如果选择的是COSMO-SAC,则列出COSMO-SAC相关的参数集。用户选择不同的参数集名字,即可看到对应参数列表数值的变化。

settings.input.CRSParameters.rav        = 0.415
settings.input.CRSParameters.aprime     = 1515.0
settings.input.CRSParameters.fcorr      = 2.812
settings.input.CRSParameters.chb        = 8850.0
settings.input.CRSParameters.sigmahbond = 0.00849
settings.input.CRSParameters.aeff       = 7.62
settings.input.CRSParameters.Lambda     = 0.129
settings.input.CRSParameters.omega      = -0.217
settings.input.CRSParameters.eta        = -9.91
settings.input.CRSParameters.chortf     = 0.816
settings.input.CRSParameters.HB_HNOF    = "" # hb for only H,N,O,F
# settings.input.CRSParameters.HB_ALL     = "" # hb for all elements
#settings.input.CRSParameters.HB_TEMP    = "" # temperature-dependent H-bond
settings.input.CRSParameters.HB_NOTEMP  = "" # non-temperature-dependent H-bond
#settings.input.CRSParameters.COMBI2005  = "" # default combinatorial term
settings.input.CRSParameters.COMBI1998  = ""

# Dispersion parameters
settings.input.Dispersion.H  = -0.0346
settings.input.Dispersion.C  = -0.0356
settings.input.Dispersion.N  = -0.0225 
settings.input.Dispersion.O  = -0.0322
#settings.input.Dispersion.F  = -0.026
#settings.input.Dispersion.Si = -0.04
#settings.input.Dispersion.P  = -0.045
#settings.input.Dispersion.S  = -0.052
settings.input.Dispersion.Cl = -0.0487
#settings.input.Dispersion.Br = -0.055
#settings.input.Dispersion.I  = -0.062

# Technical and accuracy parameters
settings.input.Technical.rsconv     = 1e-7
settings.input.Technical.maxiter    = 10000
settings.input.Technical.bpconv     = 1e-6
settings.input.Technical.bpmaxiter  = 40
settings.input.Technical.solconv    = 1e-5
settings.input.Technical.solmaxiter = 40
settings.input.Technical.solxilarge = 0.99
settings.input.Technical.ehdeltaT   = 1.0

注意其中#之后的内容表示注释,不被执行,因此可以删除或者保留均可,也不受格式限制。

2,如何在脚本中使用上述语句

找到脚本中settings.input.method = 这一行,然后在后面加插入上述内容即可。

但是要注意,上述内容必须与settings.input.method = 这一行的行首对齐,因为Python通过空格数量来确定逻辑关系。例如example4_eutectic.py,如果改为使用COSMO-RS中的ADF Combi 1998参数集,则可以在原来脚本:

import os 
import matplotlib.pyplot as plt
from scm.plams import *
 
database_path = os.getcwd()
database_path=database_path+'/coskf-DES/'
 
init()
 
#suppress plams output
config.log.stdout = 0
 
def calc_xt_curves(method,files,t_range,steps,tm,hfus):
 
    s=Settings
    # initialize settings object
    settings = Settings()
    settings.input.property._h = 'SOLUBILITY'
    settings.input.method = method
    后续省略

后面追加上述内容,追加后变为:

import os 
import matplotlib.pyplot as plt
from scm.plams import *
 
database_path = os.getcwd()
database_path=database_path+'/coskf-DES/'
 
init()
 
#suppress plams output
config.log.stdout = 0
 
def calc_xt_curves(method,files,t_range,steps,tm,hfus):
 
    s=Settings
    # initialize settings object
    settings = Settings()
    settings.input.property._h = 'SOLUBILITY'
    settings.input.method = method
 
    settings.input.CRSParameters.rav        = 0.415
    settings.input.CRSParameters.aprime     = 1515.0
    settings.input.CRSParameters.fcorr      = 2.812
    settings.input.CRSParameters.chb        = 8850.0
    settings.input.CRSParameters.sigmahbond = 0.00849
    settings.input.CRSParameters.aeff       = 7.62
    settings.input.CRSParameters.Lambda     = 0.129
    settings.input.CRSParameters.omega      = -0.217
    settings.input.CRSParameters.eta        = -9.91
    settings.input.CRSParameters.chortf     = 0.816
    settings.input.CRSParameters.HB_HNOF    = "" # hb for only H,N,O,F
# settings.input.CRSParameters.HB_ALL     = "" # hb for all elements
#settings.input.CRSParameters.HB_TEMP    = "" # temperature-dependent H-bond
    settings.input.CRSParameters.HB_NOTEMP  = "" # non-temperature-dependent H-bond
#settings.input.CRSParameters.COMBI2005  = "" # default combinatorial term
    settings.input.CRSParameters.COMBI1998  = ""
 
# Dispersion parameters
    settings.input.Dispersion.H  = -0.0346
    settings.input.Dispersion.C  = -0.0356
    settings.input.Dispersion.N  = -0.0225 
    settings.input.Dispersion.O  = -0.0322
#settings.input.Dispersion.F  = -0.026
#settings.input.Dispersion.Si = -0.04
#settings.input.Dispersion.P  = -0.045
#settings.input.Dispersion.S  = -0.052
    settings.input.Dispersion.Cl = -0.0487
#settings.input.Dispersion.Br = -0.055
#settings.input.Dispersion.I  = -0.062
 
# Technical and accuracy parameters
    settings.input.Technical.rsconv     = 1e-7
    settings.input.Technical.maxiter    = 10000
    settings.input.Technical.bpconv     = 1e-6
    settings.input.Technical.bpmaxiter  = 40
    settings.input.Technical.solconv    = 1e-5
    settings.input.Technical.solmaxiter = 40
    settings.input.Technical.solxilarge = 0.99
    settings.input.Technical.ehdeltaT   = 1.0
    后续省略

3,COSMO-SAC参数集

COSMO-SAC参数集的如下变量名字与COSMO-RS参数集的变量名字不同,这里列出一个范本,用户可以类似使用。

settings.input.SACParameters.aeff      = 6.4813
settings.input.SACParameters.fdecay    = 0.0
settings.input.SACParameters.sigma0    = 0.01233
settings.input.SACParameters.rn        = 0.0
settings.input.SACParameters.qn        = 79.532
settings.input.SACParameters.aes       = 7877.13
settings.input.SACParameters.bes       = 0.0
settings.input.SACParameters.cohoh     = 5786.72
settings.input.SACParameters.cotot     = 2739.58
settings.input.SACParameters.cohot     = 4707.75
settings.input.SACParameters.rav       = 0.51
settings.input.SACParameters.qs        = 0.57
settings.input.SACParameters.rhbcut    = 0.0
settings.input.SACParameters.omega     = 0.0
settings.input.SACParameters.eta       = 0.0
settings.input.SACParameters.HB_NOTEMP = "" # non-temperature-dependent H-bonding (default)
# settings.input.SACParameters.HB_TEMP = "" # temperature-dependent H-bonding
 
# Epsilon Constants
settings.input.Epsilon.H          = 338.13
settings.input.Epsilon["C.sp3"]   = 29160.92
settings.input.Epsilon["C.sp2"]   = 30951.83
settings.input.Epsilon["C.sp"]    = 20685.98
settings.input.Epsilon["N.sp3"]   = 23488.54
settings.input.Epsilon["N.sp2"]   = 22663.38
settings.input.Epsilon["N.sp"]    = 6390.40
settings.input.Epsilon["O.sp3-H"] = 8527.06
settings.input.Epsilon["O.sp3"]   = 8484.38
settings.input.Epsilon["O.sp2"]   = 6736.85
settings.input.Epsilon["O.sp2-N"] = 12145.28
settings.input.Epsilon.F          = 8435.13
settings.input.Epsilon.P          = 82512.21
settings.input.Epsilon.S          = 56067.81
settings.input.Epsilon.Cl         = 45065.19
settings.input.Epsilon.Br         = 62947.83
settings.input.Epsilon.I          = 105910.88
 
# Technical and accuracy parameters
settings.input.Technical.sacconv    = 1e-7
settings.input.Technical.maxiter    = 10000
settings.input.Technical.bpconv     = 1e-6
settings.input.Technical.bpmaxiter  = 40
settings.input.Technical.solconv    = 1e-5
settings.input.Technical.solmaxiter = 40
settings.input.Technical.solxilarge = 0.99
settings.input.Technical.ehdeltaT   = 1.0
adf/cosmorslecturesupple03.txt · 最后更改: 2023/05/13 11:48 由 liu.jun

© 2014-2022 费米科技(京ICP备14023855号