FitKijLij Derived Type

type, public, extends(FittingProblem) :: FitKijLij

Binary Interaction Parameters of Cubic EoS fitting problem

Fit the binary interaction parameters of a mixtures.

Description

Fitting setup for quadratic combining rules, it is possible to select which parameters will be optimized with the fit_lij and fit_kij attributes.

Examples

Fit the kij BIP

 type(CubicEoS) :: model ! Model to fit
 type(FitKijLij) :: fitting_problem ! Fitting problem specification
 type(EquilibriumState) :: exp_data(3)
 real(pr) :: X(2) ! parameter variables
 real(pr) :: error

 ! <some procedure to define exp data>

 model = PengRobinson76(tc, pc, w) ! Model to fit

 fitting_problem%exp_data = exp_data
 fitting_problem%model = model
 fitting_problem%fit_kij = .true.

 X = 0 ! initial values == 0
 err = optimize(X, fitting_problem)

References


Components

Type Visibility Attributes Name Initial
type(EquilibriumState), public, allocatable :: experimental_points(:)

Experimental points to fit

logical, public :: fit_kij = .false.

Fit the parameter

logical, public :: fit_kij_exp_t = .false.

Fit

logical, public :: fit_lij = .false.

Fit the parameter

class(ArModel), public, allocatable :: model

Residual Helmholtz Model to fit

logical, public :: verbose = .false.

If true log the fitting process


Type-Bound Procedures

procedure, public :: get_model_from_X => model_from_X

  • public subroutine model_from_X(problem, X)

    Arguments

    Type IntentOptional Attributes Name
    class(FitKijLij), intent(inout) :: problem
    real(kind=pr), intent(in) :: X(:)