DIPPR Fit Equations (chemicals.dippr)¶
This module contains implementations of various numered property equations used by the DIPPR, the Design Institude for Physical Property Research.
No actual data is included in this module; it is just functional implementations of the formulas and some of their derivatives/integrals.
For reporting bugs, adding feature requests, or submitting pull requests, please use the GitHub issue tracker.
Equations¶
- chemicals.dippr.EQ100(T: float, A: float = 0, B: float = 0, C: float = 0, D: float = 0, E: float = 0, F: float = 0, G: float = 0, order: complex = 0) float[source]¶
DIPPR Equation # 100. Used in calculating the molar heat capacities of liquids and solids, liquid thermal conductivity, and solid density. All parameters default to zero. As this is a straightforward polynomial, no restrictions on parameters apply. Note that high-order polynomials like this may need large numbers of decimal places to avoid unnecessary error.
- Parameters:
- T
float Temperature, [K]
- A
float,optional Zero-order coefficient, default=0 [-]
- B
float,optional First-order coefficient, default=0 [1/K]
- C
float,optional Second-order coefficient, default=0 [1/K^2]
- D
float,optional Third-order coefficient, default=0 [1/K^3]
- E
float,optional Fourth-order coefficient, default=0 [1/K^4]
- F
float,optional Fifth-order coefficient, default=0 [1/K^5]
- G
float,optional Sixth-order coefficient, default=0 [1/K^6]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, the first derivative of the property is returned, for -1, the indefinite integral of the property with respect to temperature is returned; and for -10, the indefinite integral of the property divided by temperature with respect to temperature is returned. No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float - Property [constant-specific; if order == 1, property/K; if order == -1,
property*K; if order == INTEGRAL_OVER_T_CALCULATION, unchanged from default]
- Y
Notes
The derivative with respect to T, integral with respect to T, and integral over T with respect to T are computed as follows. All derivatives and integrals are easily computed with SymPy.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Water liquid heat capacity; DIPPR coefficients normally listed in J/kmol/K.
>>> EQ100(300, 276370., -2090.1, 8.125, -0.014116, 0.0000093701) 75355.81000000003
- chemicals.dippr.EQ101(T, A, B, C=0.0, D=0.0, E=0.0, order=0)[source]¶
DIPPR Equation # 101. Used in calculating vapor pressure, sublimation pressure, and liquid viscosity. All 5 parameters are required. E is often an integer. As the model is exponential, a sufficiently high temperature will cause an OverflowError. A negative temperature (or just low, if fit poorly) may cause a math domain error.
- Parameters:
- T
float Temperature, [K]
- A
float First coefficient [-]
- B
float Second coefficient [K]
- C
float,optional Third coefficient, default=0 [-]
- D
float,optional Fourth coefficient, default=0 [-]
- E
float,optional Fifth coefficient (often an integer), default=0 [-]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for n, the nth derivative of the property is returned. No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float Property [constant-specific]
- Y
Notes
This function is not integrable for either dT or Y/T dT.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Water vapor pressure; DIPPR coefficients normally listed in Pa.
>>> EQ101(300, 73.649, -7258.2, -7.3037, 4.1653E-6, 2) 3537.44834545549
- chemicals.dippr.EQ102(T: float, A: float, B: float, C: float = 0.0, D: float = 0.0, order: complex = 0) float[source]¶
DIPPR Equation # 102. Used in calculating vapor viscosity, vapor thermal conductivity, and sometimes solid heat capacity. High values of B raise an OverflowError. All 4 parameters are required. C and D are often 0.
- Parameters:
- T
float Temperature, [K]
- A
float Numerator coefficient, no default [varies]
- B
float Temperature exponent, no default [-]
- C
float,optional First denominator coefficient, default=0 [K]
- D
float,optional Second denominator coefficient, default=0 [K^2]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, the first derivative of the property is returned. No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float - Property [constant-specific; if order == 1, property/K;
property*K]
- Y
Notes
The derivative with respect to T is computed as follows.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Water vapor viscosity; DIPPR coefficients normally listed in Pa*s.
>>> EQ102(300, 1.7096E-8, 1.1146, 0, 0) 9.860384711890639e-06
- chemicals.dippr.EQ104(T: float, A: float, B: float, C: float = 0.0, D: float = 0.0, E: float = 0.0, order: complex = 0) float[source]¶
DIPPR Equation #104. Often used in calculating second virial coefficients of gases. All 5 parameters are required. C, D, and E are normally large values.
- Parameters:
- T
float Temperature, [K]
- A
float Constant coefficient [varies]
- B
float Temperature coefficient [K]
- C
float,optional Cubic temperature coefficient, default=0 [K^3]
- D
float,optional Power of 8 temperature coefficient, default=0 [K^8]
- E
float,optional Power of 9 temperature coefficient, default=0 [K^9]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, the first derivative of the property is returned, for -1, the indefinite integral of the property with respect to temperature is returned; and for -10, the indefinite integral of the property divided by temperature with respect to temperature is returned. No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float - Property [constant-specific; if order == 1, property/K; if order == -1,
property*K; if order == INTEGRAL_OVER_T_CALCULATION, unchanged from default]
- Y
Notes
The derivative with respect to T, integral with respect to T, and integral over T with respect to T are computed as follows. All expressions can be obtained with SymPy readily.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Water second virial coefficient; DIPPR coefficients normally dimensionless.
>>> EQ104(300, 0.02222, -26.38, -16750000, -3.894E19, 3.133E21) -1.1204179007265156
- chemicals.dippr.EQ105(T, A, B, C, D, order=0)[source]¶
DIPPR Equation #105. Often used in calculating liquid molar density. All 4 parameters are required. C is sometimes the fluid’s critical temperature.
- Parameters:
- T
float Temperature, [K]
- A
float Multiplicative factor, [units]
- B
float Denominator power, [-]
- C
float Temperature denominator, [K]
- D
float Exponent for 1 - T/Tc usually, [-]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, 2, and 3, that derivative of the property is returned; No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float Property [constant-specific]
- Y
Notes
This expression can be integrated in terms of the incomplete gamma function for dT, however nans are the only output from that function. For Y/T dT no integral could be found.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Hexane molar density; DIPPR coefficients normally in kmol/m^3.
>>> EQ105(300., 0.70824, 0.26411, 507.6, 0.27537) 7.593170096339237
- chemicals.dippr.EQ106(T, Tc, A, B, C=0.0, D=0.0, E=0.0, order=0)[source]¶
DIPPR Equation #106. Often used in calculating liquid surface tension, and heat of vaporization. Only parameters A and B parameters are required; many fits include no further parameters. Critical temperature is also required.
- Parameters:
- T
float Temperature, [K]
- Tc
float Critical temperature, [K]
- A
float Multiplier, [various]
- B
float Tau exponent constant term, [-]
- C
float,optional Tau exponent linear term, [-]
- D
float,optional Tau exponent quadratic term, [-]
- E
float,optional Tau exponent cubic term, [-]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, 2, and 3, that derivative of the property is returned; No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float Property [constant-specific]
- Y
Notes
This form is used by Yaws with only the parameters A and B.
The integral could not be found, but the integral over T actually could, again in terms of hypergeometric functions.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Water surface tension; DIPPR coefficients normally in Pa*s.
>>> EQ106(300, 647.096, 0.17766, 2.567, -3.3377, 1.9699) 0.07231499373541
- chemicals.dippr.EQ107(T: float, A: float = 0, B: float = 0, C: float = 0, D: float = 0, E: float = 0, order: complex = 0) float[source]¶
DIPPR Equation #107. Often used in calculating ideal-gas heat capacity. All 5 parameters are required. Also called the Aly-Lee equation.
- Parameters:
- T
float Temperature, [K]
- A
float,optional Constant property term, [J/(mol*K)]
- B
float,optional First hyperbolic term multiplier, [J/(mol*K)]
- C
float,optional First hyperbolic temperature denominator, [K]
- D
float,optional Second hyperbolic term multiplier, [J/(mol*K)]
- E
float,optional Second hyperbolic temperature denominator, [K]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, the first derivative of the property is returned, for -1, the indefinite integral of the property with respect to temperature is returned; and for -10, the indefinite integral of the property divided by temperature with respect to temperature is returned. No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float - Property [constant-specific; if order == 1, property/K; if order == -1,
property*K; if order == INTEGRAL_OVER_T_CALCULATION, unchanged from default]
- Y
Notes
The derivative with respect to T, integral with respect to T, and integral over T with respect to T are computed as follows. The derivative is obtained via SymPy; the integrals from Wolfram Alpha.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
[2]Aly, Fouad A., and Lloyd L. Lee. “Self-Consistent Equations for Calculating the Ideal Gas Heat Capacity, Enthalpy, and Entropy.” Fluid Phase Equilibria 6, no. 3 (January 1, 1981): 169-79. doi:10.1016/0378-3812(81)85002-9.
Examples
Water ideal gas molar heat capacity; DIPPR coefficients normally in J/kmol/K
>>> EQ107(300., 33363., 26790., 2610.5, 8896., 1169.) 33585.90452768923
- chemicals.dippr.EQ114(T: float, Tc: float, A: float, B: float, C: float, D: float, order: complex = 0) float[source]¶
DIPPR Equation #114. Rarely used, normally as an alternate liquid heat capacity expression. All 4 parameters are required, as well as critical temperature.
- Parameters:
- T
float Temperature, [K]
- Tc
float Critical temperature, [K]
- A
float First coefficient, [-]
- B
float Second coefficient, [-]
- C
float Third coefficient, [-]
- D
float Fourth coefficient, [-]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, the first derivative of the property is returned, for -1, the indefinite integral of the property with respect to temperature is returned; and for -10, the indefinite integral of the property divided by temperature with respect to temperature is returned. No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float - Property [constant-specific; if order == 1, property/K; if order == -1,
property*K; if order == INTEGRAL_OVER_T_CALCULATION, unchanged from default]
- Y
Notes
The derivative with respect to T, integral with respect to T, and integral over T with respect to T are computed as follows. All expressions can be obtained with SymPy readily.
Strictly speaking, the integral over T has an imaginary component, but only the real component is relevant and the complex part discarded.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Hydrogen liquid heat capacity; DIPPR coefficients normally in J/kmol/K.
>>> EQ114(20, 33.19, 66.653, 6765.9, -123.63, 478.27) 19423.948911676463
- chemicals.dippr.EQ115(T, A, B, C=0, D=0, E=0, order=0)[source]¶
DIPPR Equation #115. No major uses; has been used as an alternate liquid viscosity expression, and as a model for vapor pressure. Only parameters A and B are required.
- Parameters:
- T
float Temperature, [K]
- A
float First coefficient, [-]
- B
float Second coefficient, [K]
- C
float Third coefficient, [-]
- D
float Fourth coefficient, [1/K^2]
- E
float Fifth coefficient, [K^2]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, 2, and 3, that derivative of the property is returned; No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float Property [constant-specific]
- Y
Notes
No coefficients found for this expression. This function is not integrable for either dT or Y/T dT.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
- chemicals.dippr.EQ116(T: float, Tc: float, A: float, B: float, C: float, D: float, E: float, order: complex = 0) float[source]¶
DIPPR Equation #116. Used to describe the molar density of water fairly precisely; no other uses listed. All 5 parameters are needed, as well as the critical temperature.
- Parameters:
- T
float Temperature, [K]
- Tc
float Critical temperature, [K]
- A
float First coefficient, [units]
- B
float Second coefficient, [units]
- C
float Third coefficient, [units]
- D
float Fourth coefficient, [units]
- E
float Fifth coefficient, [units]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, the first derivative of the property is returned, for -1, the indefinite integral of the property with respect to temperature is returned; and for -10, the indefinite integral of the property divided by temperature with respect to temperature is returned. No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float - Property [constant-specific; if order == 1, property/K; if order == -1,
property*K; if order == INTEGRAL_OVER_T_CALCULATION, unchanged from default]
- Y
Notes
The derivative with respect to T and integral with respect to T are computed as follows. The integral divided by T with respect to T has an extremely complicated (but still elementary) integral which can be read from the source. It was computed with Rubi; the other expressions can readily be obtained with SymPy.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Water liquid molar density; DIPPR coefficients normally in kmol/m^3.
>>> EQ116(300., 647.096, 17.863, 58.606, -95.396, 213.89, -141.26) 55.17615446406527
- chemicals.dippr.EQ127(T: float, A: float, B: float, C: float, D: float, E: float, F: float, G: float, order: complex = 0) float[source]¶
DIPPR Equation #127. Rarely used, and then only in calculating ideal-gas heat capacity. All 7 parameters are required.
- Parameters:
- T
float Temperature, [K]
- A
float Constant property term, [J/(mol*K)]
- B
float First exponential term multiplier, [J/(mol*K)]
- C
float First exponential temperature denominator, [K]
- D
float Second exponential term multiplier, [J/(mol*K)]
- E
float Second exponential temperature denominator, [K]
- F
float Third exponential term multiplier, [J/(mol*K)]
- G
float Third exponential temperature denominator, [K]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1, the first derivative of the property is returned, for -1, the indefinite integral of the property with respect to temperature is returned; and for -10, the indefinite integral of the property divided by temperature with respect to temperature is returned. No other integrals or derivatives are implemented, and an exception will be raised if any other order is given.
- T
- Returns:
- Y
float - Property [constant-specific; if order == 1, property/K; if order == -1,
property*K; if order == INTEGRAL_OVER_T_CALCULATION, unchanged from default]
- Y
Notes
The derivative with respect to T, integral with respect to T, and integral over T with respect to T are computed as follows. All expressions can be obtained with SymPy readily.
References
[1]Design Institute for Physical Properties, 1996. DIPPR Project 801 DIPPR/AIChE
Examples
Ideal gas heat capacity of methanol; DIPPR coefficients normally in J/kmol/K
>>> EQ127(20., 3.3258E4, 3.6199E4, 1.2057E3, 1.5373E7, 3.2122E3, -1.5318E7, 3.2122E3) 33258.0
- chemicals.dippr.EQ100_reciprocal(T, A=0, B=0, C=0, D=0, E=0, F=0, G=0, order=0)[source]¶
DIPPR Equation #100 reciprocal variant for temperature-dependent properties. All parameters default to zero. As this is a straightforward polynomial, no restrictions on parameters apply.
- Parameters:
- T
float Temperature, [K]
- A
float,optional Zero-order coefficient, default=0 [-]
- B
float,optional First-order coefficient, default=0 [1/K]
- C
float,optional Second-order coefficient, default=0 [1/K^2]
- D
float,optional Third-order coefficient, default=0 [1/K^3]
- E
float,optional Fourth-order coefficient, default=0 [1/K^4]
- F
float,optional Fifth-order coefficient, default=0 [1/K^5]
- G
float,optional Sixth-order coefficient, default=0 [1/K^6]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1 or 2, that derivative of the property is returned.
- T
- Returns:
- Y
float Property [constant-specific]
- Y
Examples
>>> EQ100_reciprocal(300, 1, 2, 3) 3.6954778e-06
- chemicals.dippr.EQ105_reciprocal(T, A, B, C, D, order=0)[source]¶
DIPPR Equation #105 reciprocal variant. Often used in calculating liquid molar volume. All 4 parameters are required. C is sometimes the fluid’s critical temperature.
- Parameters:
- T
float Temperature, [K]
- A
float Multiplicative factor, [units]
- B
float Denominator power, [-]
- C
float Temperature denominator, [K]
- D
float Exponent for 1 - T/C usually, [-]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1 or 2, that derivative of the property is returned.
- T
- Returns:
- Y
float Property [constant-specific]
- Y
Examples
>>> EQ105_reciprocal(300., 0.70824, 0.26411, 507.6, 0.27537) 0.1316972
- chemicals.dippr.EQ106_reciprocal(T, Tc, A, B, C=0.0, D=0.0, E=0.0, order=0)[source]¶
DIPPR Equation #106 reciprocal variant. Often used in calculating liquid surface tension and heat of vaporization. Only parameters A and B are required.
- Parameters:
- T
float Temperature, [K]
- Tc
float Critical temperature, [K]
- A
float Multiplier, [various]
- B
float Tau exponent constant term, [-]
- C
float,optional Tau exponent linear term, [-]
- D
float,optional Tau exponent quadratic term, [-]
- E
float,optional Tau exponent cubic term, [-]
- order
int,optional Order of the calculation. 0 for the calculation of the result itself; for 1 or 2, that derivative of the property is returned.
- T
- Returns:
- Y
float Property [constant-specific]
- Y
Examples
>>> EQ106_reciprocal(300, 647.096, 0.17766, 2.567, -3.3377, 1.9699) 13.82839
Jacobians (for fitting)¶
- chemicals.dippr.EQ101_fitting_jacobian(Ts, A, B, C, D, E)[source]¶
Compute and return the Jacobian of the property predicted by DIPPR Equation # 101 with respect to all the coefficients. This is used in fitting parameters for chemicals.
- chemicals.dippr.EQ102_fitting_jacobian(Ts, A, B, C, D)[source]¶
Compute and return the Jacobian of the property predicted by DIPPR Equation # 102 with respect to all the coefficients. This is used in fitting parameters for chemicals.
- chemicals.dippr.EQ105_fitting_jacobian(Ts, A, B, C, D)[source]¶
Compute and return the Jacobian of the property predicted by DIPPR Equation # 105 with respect to all the coefficients. This is used in fitting parameters for chemicals.
- chemicals.dippr.EQ106_fitting_jacobian(Ts, Tc, A, B, C, D, E)[source]¶
Compute and return the Jacobian of the property predicted by DIPPR Equation # 106 with respect to all the coefficients. This is used in fitting parameters for chemicals.
- Parameters:
- Returns: