rmgpy.thermo.Wilhoit¶
- class rmgpy.thermo.Wilhoit(Cp0=None, CpInf=None, a0=0.0, a1=0.0, a2=0.0, a3=0.0, H0=None, S0=None, B=None, Tmin=None, Tmax=None, label='', comment='')¶
A heat capacity model based on the Wilhoit equation. The attributes are:
Attribute
Description
a0
The zeroth-order Wilhoit polynomial coefficient
a1
The first-order Wilhoit polynomial coefficient
a2
The second-order Wilhoit polynomial coefficient
a3
The third-order Wilhoit polynomial coefficient
H0
The integration constant for enthalpy (not H at T=0)
S0
The integration constant for entropy (not S at T=0)
E0
The energy at zero Kelvin (including zero point energy)
B
The Wilhoit scaled temperature coefficient in K
Tmin
The minimum temperature in K at which the model is valid, or zero if unknown or undefined
Tmax
The maximum temperature in K at which the model is valid, or zero if unknown or undefined
comment
Information about the model (e.g. its source)
The Wilhoit polynomial is an expression for heat capacity that is guaranteed to give the correct limits at zero and infinite temperature, and gives a very reasonable shape to the heat capacity profile in between:
\[C_\mathrm{p}(T) = C_\mathrm{p}(0) + \left[ C_\mathrm{p}(\infty) - C_\mathrm{p}(0) \right] y^2 \left[ 1 + (y - 1) \sum_{i=0}^3 a_i y^i \right]\]Above, \(y \equiv T/(T + B)\) is a scaled temperature that ranges from zero to one based on the value of the coefficient \(B\), and \(a_0\), \(a_1\), \(a_2\), and \(a_3\) are the Wilhoit polynomial coefficients.
The enthalpy is given by
\[\begin{split}H(T) & = H_0 + C_\mathrm{p}(0) T + \left[ C_\mathrm{p}(\infty) - C_\mathrm{p}(0) \right] T \\ & \left\{ \left[ 2 + \sum_{i=0}^3 a_i \right] \left[ \frac{1}{2}y - 1 + \left( \frac{1}{y} - 1 \right) \ln \frac{T}{y} \right] + y^2 \sum_{i=0}^3 \frac{y^i}{(i+2)(i+3)} \sum_{j=0}^3 f_{ij} a_j \right\}\end{split}\]where \(f_{ij} = 3 + j\) if \(i = j\), \(f_{ij} = 1\) if \(i > j\), and \(f_{ij} = 0\) if \(i < j\).
The entropy is given by
\[S(T) = S_0 + C_\mathrm{p}(\infty) \ln T - \left[ C_\mathrm{p}(\infty) - C_\mathrm{p}(0) \right] \left[ \ln y + \left( 1 + y \sum_{i=0}^3 \frac{a_i y^i}{2+i} \right) y \right]\]The low-temperature limit \(C_\mathrm{p}(0)\) is \(3.5R\) for linear molecules and \(4R\) for nonlinear molecules. The high-temperature limit \(C_\mathrm{p}(\infty)\) is taken to be \(\left[ 3 N_\mathrm{atoms} - 1.5 \right] R\) for linear molecules and \(\left[ 3 N_\mathrm{atoms} - (2 + 0.5 N_\mathrm{rotors}) \right] R\) for nonlinear molecules, for a molecule composed of \(N_\mathrm{atoms}\) atoms and \(N_\mathrm{rotors}\) internal rotors.
- B¶
The Wilhoit scaled temperature coefficient.
- Cp0¶
The heat capacity at zero temperature.
- CpInf¶
The heat capacity at infinite temperature.
- E0¶
The ground state energy (J/mol) at zero Kelvin, including zero point energy.
For the Wilhoit class, this is calculated as the Enthalpy at 0.001 Kelvin.
- H0¶
The integration constant for enthalpy.
NB. this is not equal to the enthlapy at 0 Kelvin, which you can access via E0
- S0¶
The integration constant for entropy.
- Tmax¶
The maximum temperature at which the model is valid, or
None
if not defined.
- Tmin¶
The minimum temperature at which the model is valid, or
None
if not defined.
- a0¶
‘double’
- Type:
a0
- a1¶
‘double’
- Type:
a1
- a2¶
‘double’
- Type:
a2
- a3¶
‘double’
- Type:
a3
- as_dict(self) dict ¶
A helper function for YAML parsing
- comment¶
unicode
- Type:
comment
- discrepancy(self, HeatCapacityModel other) double ¶
Return some measure of how dissimilar self is from other.
The measure is arbitrary, but hopefully useful for sorting purposes. Discrepancy of 0 means they are identical
- fit_to_data(self, ndarray Tdata, ndarray Cpdata, double Cp0, double CpInf, double H298, double S298, double B0=500.0)¶
Fit a Wilhoit model to the data points provided, allowing the characteristic temperature B to vary so as to improve the fit. This procedure requires an optimization, using the
fminbound
function in thescipy.optimize
module. The data consists of a set of heat capacity points Cpdata in J/mol*K at a given set of temperatures Tdata in K, along with the enthalpy H298 in kJ/mol and entropy S298 in J/mol*K at 298 K. The linearity of the molecule, number of vibrational frequencies, and number of internal rotors (linear, Nfreq, and Nrotors, respectively) is used to set the limits at zero and infinite temperature.
- fit_to_data_for_constant_b(self, ndarray Tdata, ndarray Cpdata, double Cp0, double CpInf, double H298, double S298, double B)¶
Fit a Wilhoit model to the data points provided using a specified value of the characteristic temperature B. The data consists of a set of dimensionless heat capacity points Cpdata at a given set of temperatures Tdata in K, along with the dimensionless heat capacity at zero and infinite temperature, the dimensionless enthalpy H298 at 298 K, and the dimensionless entropy S298 at 298 K.
- get_enthalpy(self, double T) double ¶
Return the enthalpy in J/mol at the specified temperature T in K.
- get_entropy(self, double T) double ¶
Return the entropy in J/mol*K at the specified temperature T in K.
- get_free_energy(self, double T) double ¶
Return the Gibbs free energy in J/mol at the specified temperature T in K.
- get_heat_capacity(self, double T) double ¶
Return the constant-pressure heat capacity in J/mol*K at the specified temperature T in K.
- is_identical_to(self, HeatCapacityModel other) bool ¶
Returns
True
if self and other report very similar thermo values for heat capacity, enthalpy, entropy, and free energy over a wide range of temperatures, orFalse
otherwise.
- is_similar_to(self, HeatCapacityModel other) bool ¶
Returns
True
if self and other report similar thermo values for heat capacity, enthalpy, entropy, and free energy over a wide range of temperatures, orFalse
otherwise.
- is_temperature_valid(self, double T) bool ¶
Return
True
if the temperature T in K is within the valid temperature range of the thermodynamic data, orFalse
if not. If the minimum and maximum temperature are not defined,True
is returned.
- label¶
unicode
- Type:
label
- make_object(self, dict data, dict class_dict)¶
A helper function for constructing objects from a dictionary (used when loading YAML files)
- Parameters:
data (dict) – The dictionary representation of the object
class_dict (dict) – A mapping of class names to the classes themselves
- Returns:
None
- to_nasa(self, double Tmin, double Tmax, double Tint, bool fixedTint=False, bool weighting=True, int continuity=3) NASA ¶
Convert the Wilhoit object to a
NASA
object. You must specify the minimum and maximum temperatures of the fit Tmin and Tmax in K, as well as the intermediate temperature Tint in K to use as the bridge between the two fitted polynomials. The remaining parameters can be used to modify the fitting algorithm used:fixedTint -
False
to allow Tint to vary in order to improve the fit, orTrue
to keep it fixedweighting -
True
to weight the fit by \(T^{-1}\) to emphasize good fit at lower temperatures, orFalse
to not use weightingcontinuity - The number of continuity constraints to enforce at Tint:
0: no constraints on continuity of \(C_\mathrm{p}(T)\) at Tint
1: constrain \(C_\mathrm{p}(T)\) to be continous at Tint
2: constrain \(C_\mathrm{p}(T)\) and \(\frac{d C_\mathrm{p}}{dT}\) to be continuous at Tint
3: constrain \(C_\mathrm{p}(T)\), \(\frac{d C_\mathrm{p}}{dT}\), and \(\frac{d^2 C_\mathrm{p}}{dT^2}\) to be continuous at Tint
4: constrain \(C_\mathrm{p}(T)\), \(\frac{d C_\mathrm{p}}{dT}\), \(\frac{d^2 C_\mathrm{p}}{dT^2}\), and \(\frac{d^3 C_\mathrm{p}}{dT^3}\) to be continuous at Tint
5: constrain \(C_\mathrm{p}(T)\), \(\frac{d C_\mathrm{p}}{dT}\), \(\frac{d^2 C_\mathrm{p}}{dT^2}\), \(\frac{d^3 C_\mathrm{p}}{dT^3}\), and \(\frac{d^4 C_\mathrm{p}}{dT^4}\) to be continuous at Tint
Note that values of continuity of 5 or higher effectively constrain all the coefficients to be equal and should be equivalent to fitting only one polynomial (rather than two).
Returns the fitted
NASA
object containing the two fittedNASAPolynomial
objects.
- to_thermo_data(self) ThermoData ¶
Convert the Wilhoit model to a
ThermoData
object.