Index
SolMod.NRTL_activityCoefficient
SolMod.NRTL_exportParameters
SolMod.NRTL_importParameters
SolMod.NRTL_solubilityCurve
SolMod.UNIQUAC_FredenslundParameters
SolMod.UNIQUAC_activityCoefficient
SolMod.errorAnalysis
SolMod.exportSolubility
SolMod.exportTernaryPhase
SolMod.idealActivityCoefficient
SolMod.importSolubility
SolMod.importTernaryPhase
SolMod.solubilityPoint
SolMod.ternaryPhase
Base Functions
SolMod.idealActivityCoefficient
— FunctionidealActivityCoefficient(; x::Vector = [0.3, 0.2, 0.5])
The function will always output an activity coefficient of 1
Optional:
- x = Vector that includes the composition of the soluion. Automatically set to [0.3, 0.2, 0.5]
SolMod.importSolubility
— FunctionimportSolubility(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:
- filepath = String that includes the filepath of the xlsx file that we are intending to import
SolMod.exportSolubility
— FunctionexportSolubility(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:
- 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
- outputfile = String that includes the filepath of the xlsx file that we are intending to export
Optional:
- solvents = Vector that includes strings of the solvents that are used for the solubility prediction
SolMod.importTernaryPhase
— FunctionimportTernaryPhase(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:
- filepath = String that includes the filepath of the xlsx file that we are intending to import
SolMod.exportTernaryPhase
— FunctionexportTernaryPhase(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:
- 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
- outputfile = String that includes the filepath of the xlsx file that we are intending to export
Optional:
- temperatures = Vector that includes strings of the solvents that are used for the solubility prediction. Automatically uses all the keys in the exp dictionary
SolMod.ternaryPhase
— FunctionternaryPhase(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:
- 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
- solvent = String of the solvent used for the modeling
- γix = Activtiy coefficient of the i component at temperature Tx in the x compositon
- γjx = Activtiy coefficient of the j component at temperature Tx in the x compositon
- Tx = Value of the type Int64/Float64 of the temperature used to determine the activity coefficient
Optional:
- x_step = Step size of the molar composition increments. Automatically set to 0.001
- x_start = Start of the iteration of the molar composition. Automatically set to 0.001
- x_end = End of the iteration of the molar composition. Automatically set to 0.999
- 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
- pp = Boolean that allows the post-processing of the output array will be done to remove any points beyond the eutectic points
SolMod.solubilityPoint
— FunctionsolubilityPoint(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:
- 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
- γix = Activtiy coefficient of the i component at temperature Tx in the x compositon
- γjx = Activtiy coefficient of the j component at temperature Tx in the x compositon
- Tx = Value of the type Int64/Float64 of the temperature used to determine the activity coefficient
Optional:
- R = Value of the type Int64/Float64 that represents the ideal gas constant. Automatically set to 8.314
- 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
- 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
- fusΔH = Enthalpy of fusion of the solute
- Tm = Melting temperature of the solute
- fusΔH_rac = Enthalpy of fusion of the racemate
- Tm_rac = Melting temperature of the racemate
SolMod.errorAnalysis
— FunctionerrorAnalysis(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:
- 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.
- 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.
- components = Integer value that specifies the number of components
NRTL
SolMod.NRTL_activityCoefficient
— FunctionNRTL_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:
- 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
- solvent = String of the solvent used for the modeling
- Tx = Value of the type Int64/Float64 of the temperature used to determine the activity coefficient
Optional:
- R = Value of the type Int64/Float64 that represents the ideal gas constant. Automatically set to 8.314
- e = Boolean for enantiomeric processes to determine the activity coefficient of the opposite enantiomer. Automatically set to false
- x = Vector that includes the composition of the soluion. Automatically set to [0.3, 0.2, 0.5]
- components = Integer value that represents the number of components in the solution. Automatically set to 3
SolMod.NRTL_exportParameters
— FunctionNRTL_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:
- 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.
- 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
- outputfile = String that includes the filepath of the xlsx file that we are intending to export
Optional:
- sol = Vector that includes a list of strings that are the solvents used for the modeling. Automatically loads the keys of the params dictionary
SolMod.NRTL_importParameters
— FunctionNRTL_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:
- filepath = String that includes the filepath of the xlsx file that we are intending to import
- 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
SolMod.NRTL_solubilityCurve
— FunctionNRTL_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:
- 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
- T = Vector of length 2 that includes the start and the end temperature for the solubility curve
- solvent = String of the solvent used for the modeling
Optional:
- j = Float or integer value that represents the constant amount of the opposite enantiomer in the solution. Automatically set to 0
- 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
- components = Integer value that represents the number of components in the solution. Automatically set to 3
- 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
- R = Value of the type Int64/Float64 that represents the ideal gas constant. Automatically set to 8.314
UNIQUAC
SolMod.UNIQUAC_activityCoefficient
— FunctionUNIQUAC_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:
- 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
- solvent = String of the solvent used for the modeling
- Tx = Value of the type Int64/Float64 of the temperature used to determine the activity coefficient
Optional:
- R = Value of the type Int64/Float64 that represents the ideal gas constant. Automatically set to 8.314
- e = Boolean for enantiomeric processes to determine the activity coefficient of the opposite enantiomer. Automatically set to false
- x = Vector that includes the composition of the soluion. Automatically set to [0.3, 0.2, 0.5]
SolMod.UNIQUAC_FredenslundParameters
— FunctionUNIQUAC_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:
- x = Vector that includes a list of strings that are the molecular components of the full molecule
Optional:
- database = dataframe of the predetermined molecular component values from the UNIFAC/UNIQUAC
Missing docstring for SolMod.UNIQUAC_solubilityCurve
. Check Documenter's build log for details.