Parametrization

Fit to Experimental Data

Parameters can be fit for one component at a time, and as many parameters as desired can be fit. Input file structure is very similar to before with the mandatory addition of an optimization_parameters section whose presence will signify to DESPASITO that this is a fitting job. Here we summarize the available experimental data types that are currently supported for fitting, followed by the description of the main fitting function containing more details.

Fit Parameters

This package uses functions from input_output, equations_of_state, and thermodynamics to fit parameters to experimental data.

input.json files have a different dictionary structure that is processed by process_param_fit_inputs().

fit(optimization_parameters=None, exp_data=None, global_opts={}, minimizer_opts=None, MultiprocessingObject=None, **kwargs)[source]

Fit parameters for an equation of state object with given experimental data.

Each set of experimental data is converted to an object with the built in ability to evaluate its part of objective function. To add another type of supported experimental data, add a class to the fit_classes.py file.

Parameters:
  • optimization_parameters (dict, Optional, default=None) – Parameters used in global fitting algorithm.

    • fit_bead (str) - Name of bead whose parameters are being fit. Should be

    within bead_configuration. - fit_parameter_names (list[str]) - This list contains the name of the parameter being fit (e.g. epsilon). See EOS documentation for supported parameter names. Cross interaction parameter names should be composed of a parameter name followed by the interacting bead’s name, separated by an underscore (e.g. epsilon_CO2). - parameters_guess (list[float]), Optional - Initial guess for all parameters being fit. If this is not provided, the Eos object provides a guesses based on the parameter types. - *_bounds (list[float]), Optional - This list contains the minimum and maximum of the parameter from a parameter listed in fit_parameter_names, represented in place of the asterisk. See , Get Started Fitting Parameters, for more information.

  • exp_data (dict, Optional, default=None) – This dictionary is made up of a dictionary for each data set that the parameters are fit to. Each dictionary is converted into an object and saved back to this structure before parameter fitting begins. Each key is an arbitrary string used to identify the data set and used later in reporting objective function values during the fitting process. See data type objects for more details.

    • data_class_type (str) - One of the supported data type objects to fit

    parameters, Available Data Types. - eos_obj (obj) - Equation of state output that writes pressure, max density, fugacity coefficient, updates parameters, and evaluates parameter fitting objective function. See equation of state documentation for more details.

  • global_opts (dict, Optional, default={}) – Method and keyword arguments used in global optimization method. See global_minimization().

    • method (str), Optional - default=’differential_evolution’, Global

    optimization method used to fit parameters. See global_minimization(). - Additional options, specific to the global optimization method

  • minimizer_opts (dict, Optional, default=None) – Dictionary used to define minimization type and the associated options.

    • method (str) - Method available to scipy.optimize.minimize

    • options (dict) - This dictionary contains the keyword arguments available

    to the chosen method

  • MultiprocessingObject (obj, Optional) – Multiprocessing object, MultiprocessingJob

  • kwargs – Other keywords of instructions for thermodynamic calculations and parameter fitting.

Returns:

output – Results from parameter optimization

  • parameters_final (numpy.ndarray) - Array of the same length as

fit_parameter_names containing the parameters resulting from the chosen global optimization method. - objective_value (float) - Objective value resulting from parameters_final

Return type:

dict

Available Data Types

flash.Data(data_dict)

Object for flash calculation.

liquid_density.Data(data_dict)

Object for liquid density data.

saturation_properties.Data(data_dict)

Object for saturation data.

solubility_parameter.Data(data_dict)

Object for Hildebrand solubility parameters.

TLVE.Data(data_dict)

Object for Temperature dependent VLE data.

Supporting Thermodynamic Functions

fit_functions

Functions needed for parameter fitting process.

global_methods

The function names of this module represents global optimization methods that can be specified as global_opts["method"] in fit().

constraint_types

Optional constraint functions extracted for global_minimization() method.

Estimate with Electronic Structure Methods

In SAFT, self-interaction parameters are often fit to experimental data, and in most cases so are the cross-interaction parameters (between segments of different types). In a work nearing publication, we derived combining rules extended to utilize multipole moments of molecular fragments from density functional theory (DFT) methods using R.E.D. server [1]. Once the multipole moments of molecular fragments are obtained, the temperature dependent parameters can be directly predicted in DESAPSITO with the package, MAPSCI, as a plug-in. Alternatively, the parameters could be estimated with MAPSCI separately and fine tuned to be independent of temperature in an iterative fashion.

[1] Vanquelef, E.; Simon, S.; Marquant, G.; Garcia, E.; Klimerak, G.; Delepine, J. C.; Cieplak, P.; Dupradeau, F.-Y. R.E.D. Server: A Web Service for Deriving RESP and ESP Charges and Building Force Field Libraries for New Molecules and Molecular Fragments. Nucleic Acids Res. 2011, 39 (suppl_2), W511–W517. https://doi.org/10.1093/nar/gkr288