Index

Base Functions

SolMod.idealActivityCoefficientFunction
idealActivityCoefficient(; x::Vector = [0.3, 0.2, 0.5])

The function will always output an activity coefficient of 1

Optional:

  1. x = Vector that includes the composition of the soluion. Automatically set to [0.3, 0.2, 0.5]
source
SolMod.importSolubilityFunction
importSolubility(filepath::String)

Using the package XLSX we import the first 2 columns of every sheet in the xlsx file. Every sheet name will be the key of our dictionary and the values will be the 2 columns in the sheet

Inputs:

  1. filepath = String that includes the filepath of the xlsx file that we are intending to import
source
SolMod.exportSolubilityFunction
exportSolubility(exp, outputfile::String; solvents::Vector = collect(keys(exp)))

Using the package XLSX we export the dictionary as a dataframe to construct 2 columns in every sheet of the xlsx file for every solvent

Inputs:

  1. exp = Dictionary that includes the keys for the solvents and the values that correspond to the temperature and molecular fraction composition of the target molecule
  2. outputfile = String that includes the filepath of the xlsx file that we are intending to export

Optional:

  1. solvents = Vector that includes strings of the solvents that are used for the solubility prediction
source
SolMod.importTernaryPhaseFunction
importTernaryPhase(filepath::String)

Using the package XLSX we import the the first 3 columns of every sheet in the xlsx file. Every sheet name will be the key of our dictionary and the values will be the 3 columns in the sheet

Inputs:

  1. filepath = String that includes the filepath of the xlsx file that we are intending to import
source
SolMod.exportTernaryPhaseFunction
exportTernaryPhase(exp, outputfile::String; temperatures::Vector = collect(keys(exp)))

Using the package XLSX we export the dictionary as a dataframe to construct 3 columns in every sheet of the xlsx file for every temperature

Inputs:

  1. exp = Dictionary that includes the keys for the temperatures and the values that correspond to the molecular fraction composition of the R(x1) and S(x2) enantiomers and the solvent(x_3) used
  2. outputfile = String that includes the filepath of the xlsx file that we are intending to export

Optional:

  1. temperatures = Vector that includes strings of the solvents that are used for the solubility prediction. Automatically uses all the keys in the exp dictionary
source
SolMod.ternaryPhaseFunction
ternaryPhase(params::Dict, γi, γj, Tx; x_step::Float64 = 0.001, x_start::Float64 = 0.001, 
x_end::Float64 = 0.999, round1::Int64 = 3, round2::Int64 = 3, round3::Int64 = 3, pp::Bool = true, 
e::Bool = true)

The function will find the activity coefficient of the R enantiomer and the S enantiomer and checks if the Schrödenberg Van Laar equation and the Prigogine and Defay equation is correct. This is done for every molar composition possible. When the solubility equation is true, the molar composition is appended to an array. The array is then processed to remove solubility points beyond the eutectic points

Inputs:

  1. params = Dictionary that includes the solvents used as keys and the respective interaction parameters. The solute key contains the calorimetric data of the target molecule as an array
  2. solvent = String of the solvent used for the modeling
  3. γix = Activtiy coefficient of the i component at temperature Tx in the x compositon
  4. γjx = Activtiy coefficient of the j component at temperature Tx in the x compositon
  5. Tx = Value of the type Int64/Float64 of the temperature used to determine the activity coefficient

Optional:

  1. x_step = Step size of the molar composition increments. Automatically set to 0.001
  2. x_start = Start of the iteration of the molar composition. Automatically set to 0.001
  3. x_end = End of the iteration of the molar composition. Automatically set to 0.999
  4. round# = This affects the sensitivity of the solubility equation. This rounds to the specified number of digits after the decimal place. Automatically set to 4 for the solubility of the enantiomers and 3 for the solubility of the racemate
  5. pp = Boolean that allows the post-processing of the output array will be done to remove any points beyond the eutectic points
source
SolMod.solubilityPointFunction
solubilityPoint(params::Dict, Tx; R = 8.314, e_1 = true, e_2 = true, 
cal_params = params["Solute"], x::Vector = [0.3, 0.2, 0.5], γi = 1,  γj = 1)

Solubility is modeled acording to the Schrödenberg Van Laar equation:

log(xi γi) = (fusΔH / R) (1 / Tm - 1 / T)

Solubility of the racemate is modeled acording to the Prigogine and Defay equation:

log(4 γi γj xi xj) = ( 2 fusΔHrac/R ) ( 1 / Tmrac - 1 / T )

Which details that the solubility of the racemate can be easily computed with the respective calorimetric properties, where fusΔH_rac is the enthalpy of fusion and Tm is the melting temperature of the racemate.

Inputs:

  1. params = Dictionary that includes the solvents used as keys and the respective interaction parameters. The solute key contains the calorimetric data of the target molecule as an array
  2. γix = Activtiy coefficient of the i component at temperature Tx in the x compositon
  3. γjx = Activtiy coefficient of the j component at temperature Tx in the x compositon
  4. Tx = Value of the type Int64/Float64 of the temperature used to determine the activity coefficient

Optional:

  1. R = Value of the type Int64/Float64 that represents the ideal gas constant. Automatically set to 8.314
  2. e1 = Boolean to determine the solubility of the i component in the solution. Automatically set to true. If e2 is also true, the solubility of the racemate product will be determined
  3. e2 = Boolean to determine the solubility of the j component in the solution. Automatically set to true. If e1 is also true, the solubility of the racemate product will be determined
  4. fusΔH = Enthalpy of fusion of the solute
  5. Tm = Melting temperature of the solute
  6. fusΔH_rac = Enthalpy of fusion of the racemate
  7. Tm_rac = Melting temperature of the racemate
source
SolMod.errorAnalysisFunction
errorAnalysis(model, experimental, components)

Using the package XLSX we export the dictionary as a dataframe to construct 2 columns in every sheet of the xlsx file for every solvent

Inputs:

  1. model = Array that includes the temperature in the first column, molar composition of the R enantiomer on the second column, and/or the molar composition of the S enantiomer depending on the component value.
  2. experimental = Array that includes the keys for the solvents and the values that correspond to the temperature and molecular fraction composition of the target molecule.
  3. components = Integer value that specifies the number of components
source

NRTL

SolMod.NRTL_activityCoefficientFunction
NRTL_activityCoefficient(params::Dict, solvent::String, Tx::Union{Float64, Int64}; 
R::Union{Float64, Int64} = 8.314, e = false, x::Vector = [0.3, 0.2, 0.5], components::Int64 = 3)

To determine the activity coefficient of the system at the specified composition we use the NRTL activity coefficient model:

lnγi = ∑j=1 (xj 𝜏ji Gji) / ∑k=1 (xk Gkj) + ∑j=1 (xj Gij / ∑ (xk Gkj) (𝜏ji - ( ∑m=1 (xm 𝜏mj Gmj) / ∑k=1 (xk Gkj))))

γi is the activity coefficient of component i, x is the molar fraction of the i component, and 𝜏 and G are the binary parameters that truly define the NRTL model

The interaction parameters 𝜏 and G are defined by the equations:

𝜏ij = gij - gjj / (T R) Gij = 𝘦 ^(-⍺ij 𝜏ij)

𝜏 defines the temperature dependency in the equation. The parameter g is obtained from experimental data, where gij is the interaction between two components in the solution while gjj can be chosen freely as a reference state. R is defined as the ideal gas constant. 𝜏 can then be used in the definition for G, which also contains the nonrandomness parameter ⍺. This parameter has no true physical meaning, and can be chosen at a value close to 0.3 in most literature

By using the boolean "e" parameter The function will find the activity coefficient of the R enantiomer and the S enantiomer

Inputs:

  1. params = Dictionary that includes the solvents used as keys and the respective interaction parameters. The solute key contains the calorimetric data of the target molecule as an array
  2. solvent = String of the solvent used for the modeling
  3. Tx = Value of the type Int64/Float64 of the temperature used to determine the activity coefficient

Optional:

  1. R = Value of the type Int64/Float64 that represents the ideal gas constant. Automatically set to 8.314
  2. e = Boolean for enantiomeric processes to determine the activity coefficient of the opposite enantiomer. Automatically set to false
  3. x = Vector that includes the composition of the soluion. Automatically set to [0.3, 0.2, 0.5]
  4. components = Integer value that represents the number of components in the solution. Automatically set to 3
source
SolMod.NRTL_exportParametersFunction
NRTL_exportParameters(params, components::Int64, outputfile::String; 
sol::Vector = deleteat!(collect(keys(params)), findall(x->x=="Solute", collect(keys(params)))))

Using the package XLSX we export the dictionary as a dataframe to a sheet of the xlsx file for every solvent. The first sheet will always contain the calorimetric data of the molecule. If 2 components are specified, the sheet will contain a 2x2 matrix of the interaction parameters of the molecule and the solvent. If 3 components are specified, the sheet will contain a 3x3 matrix of the interaction parameters of the R and S enantiomer and the solvent

Inputs:

  1. params = Dictionary that includes the keys for the solute (first sheet) and the solvents used. The values correspond to the parameters used in the model.
  2. components = An integer that should be either a 2 or a 3. A 2 component system would be used to model a system made up of a target molecule and its solvent. A 3 component system would be used to model a system with an R and S enantiomer along with its solvent
  3. outputfile = String that includes the filepath of the xlsx file that we are intending to export

Optional:

  1. sol = Vector that includes a list of strings that are the solvents used for the modeling. Automatically loads the keys of the params dictionary
source
SolMod.NRTL_importParametersFunction
NRTL_importParameters(filepath::String, components::Int64)

Using the package XLSX we import the data from the xlsx file as a dataframe to a dictionary where the keys are the solute and the solvents used. The first sheet contains the calorimetric data of the molecule and will be added as a value to the solute key. When 3 components are specified, aditional calorimetric data for the racemic product will be added as the values [3], and [4] If 2 components are specified, the 2x2 matrix of the interaction parameters of the molecule and the solvent will be imported as a value to their respective solvent keys. If 3 components are specified, the 3x3 matrix of the interaction parameters of the molecule and the solvent will be imported as a value to their respective solvent keys

Inputs:

  1. filepath = String that includes the filepath of the xlsx file that we are intending to import
  2. components = An integer that should be either a 2 or a 3. A 2 component system would be used to model a system made up of a target molecule and its solvent. A 3 component system would be used to model a system with an R and S enantiomer along with its solvent
source
SolMod.NRTL_solubilityCurveFunction
NRTL_solubilityCurve(params::Dict,  T::Vector, solvent::String; j::Union{Float64, Int64} = 0, 
guess::Union{Float64, Int64} = 0, components = 3, Ti_step::Union{Float64, Int64} = 1, 
R::Union{Float64, Int64} = 8.314)

Inputs:

  1. params = Dictionary that includes the solvents used as keys and the respective interaction parameters. The solute key contains the calorimetric data of the target molecule as an array
  2. T = Vector of length 2 that includes the start and the end temperature for the solubility curve
  3. solvent = String of the solvent used for the modeling

Optional:

  1. j = Float or integer value that represents the constant amount of the opposite enantiomer in the solution. Automatically set to 0
  2. guess = Float or integer value that represents a guess of the solubility point at the initial temperature. This can be inferred from experimental information. Automatically set to 0
  3. components = Integer value that represents the number of components in the solution. Automatically set to 3
  4. Ti_step = Float or integer value that represents the stepsize of the temperature iterations between the start temperature to the final temperature in the T vector. Automatically set to 1
  5. R = Value of the type Int64/Float64 that represents the ideal gas constant. Automatically set to 8.314
source

UNIQUAC

SolMod.UNIQUAC_activityCoefficientFunction
UNIQUAC_activityCoefficient(i_params::Dict, m_params::Matrix, Tx::Union{Float64, Int64}, 
solvent::String; e = false, x::Vector = [0.3, 0.2, 0.5], z::Int64 = 10, components = 3)

To determine the activity coefficient of the system at the specified composition we use the UNIQUAC activity coefficient model:

lnγi = ln (ɸ/xi) + (z/2) qi ln (θ/ɸ) + li - (ɸ/xi) ∑(xj lj) + qi[1 - ln(∑ {θ 𝜏{j i}}) - ∑ (θ 𝜏{i j})/(∑ {θ 𝜏})]

Inputs:

  1. params = Dictionary that includes the solvents used as keys and the respective interaction parameters. The solute key contains the calorimetric data of the target molecule as an array
  2. solvent = String of the solvent used for the modeling
  3. Tx = Value of the type Int64/Float64 of the temperature used to determine the activity coefficient

Optional:

  1. R = Value of the type Int64/Float64 that represents the ideal gas constant. Automatically set to 8.314
  2. e = Boolean for enantiomeric processes to determine the activity coefficient of the opposite enantiomer. Automatically set to false
  3. x = Vector that includes the composition of the soluion. Automatically set to [0.3, 0.2, 0.5]
source
SolMod.UNIQUAC_FredenslundParametersFunction
UNIQUAC_FredenslundParameters(x::Vector; 
database = pathof(SolMod)[1:end-13]*"examples/Database/UNIQUAC-UNIFAC molecular parameters.xlsx")

Calculates the variables r and q as a measure of the molecule's size and external surface area to use in the UNIQUAC model.

Inputs:

  1. x = Vector that includes a list of strings that are the molecular components of the full molecule

Optional:

  1. database = dataframe of the predetermined molecular component values from the UNIFAC/UNIQUAC
source
Missing docstring.

Missing docstring for SolMod.UNIQUAC_solubilityCurve. Check Documenter's build log for details.