constrain_Ki
despasito.thermodynamics.calc.constrain_Ki
- constrain_Ki(Ki0, min_mole_fraction0=0, max_mole_fraction0=1, **kwargs)[source]
For a binary mixture, determine whether the K values will produce properly constrained mole fractions.
If not, randomly choose a value of Ki[1] within the allowed range.
- Parameters:
Ki (numpy.ndarray) – K values for a binary mixture
min_mole_fraction0 (float, Optional, default=0) – Set the vapor and liquid mole fraction of component one to be greater than this number. Useful for diagrams with multiple solutions, such as those with an azeotrope.
max_mole_fraction0 (float, Optional, default=1) – Set the vapor and liquid mole fraction of component one to be less than this number. Useful for diagrams with multiple solutions, such as those with an azeotrope.
- Returns:
Ki_new (numpy.ndarray) – New suggestion for K values for a binary mixture
flag_reset (bool) – True or False value indicating that the K values were reset.