We have implemented a Matlab demonstration program to fit tabular thermodynamic data with a constrainted least squares fit. With this program, output for direct use in a Cantera mechanism is created. Additionally, output in the CHEMKIN format is created. Thus, a user may creat new mechanisms or append this output to existing mechanisms, replacing or creating thermodynamic coefficients for a species.

Documentation discussing algorithm used for this demo, See specifically the "Thermodynamic Property Polynomial Representation" appendix.

- Demo Script
- Matlab Fitting Program
- Tabular Thermo Data
- Output in CHEMKIN format
- Ouput in Cantera .cti file format

The user-defined input for the fitting program includes the temperature ranges, the standard state enthalpy of formation and standard state entropy, the species name, and the species molecular composition. The molecular composition is specified by typing at the Matlab prompt at run time. For this example, there are 3 types of atoms, four carbon, six hydrogen, and one oxygen atom so the input is "3 'Enter' C 'Enter' 4 'Enter' H 'Enter' 6 'Enter' O 'Enter' 1 'Enter".

Example fits, for two-butenal appear below, with Tmin = 200 K, Tmid = 2500 K, and Tmax = 5000 K. The piecewise function was fitted using the constrained least-squares method in Matlab. All three piecewise functions for the non-dimensional properties, cp(T)/R, h(T)/RT, and s0(T)/R (pressure independent entropy), were simultaneously optimized and constrained for the best overall fit. The constraints include continuity for h(T)/RT and s0(T)/R and continuity for both cp(T)/R and its derivatives. Also, the boundary point constraints for cp(T)/R and h(T)/RT are included.

Figure: Comparison of Properties for 2-Butenal (CH3CHCHCHO) calculated from the statistical mechanics representation (points) to the piecewise polynomial fit (solid lines).