VlachosGroup / pMuTT

Python Multiscale Thermochemistry Toolbox (pMuTT)
https://vlachosgroup.github.io/pMuTT/
41 stars 23 forks source link

Optimizing T_mid for NASA and NASA9 polynomials #98

Open jonlym opened 5 years ago

jonlym commented 5 years ago

Currently, converting a model object (e.g. StatMech) to a Nasa object is done in the following steps:

  1. Use the model object to generate CpoR, HoRT, and SoR data.
  2. Determine T_mid by iteratively partitioning a low range and a high range of temperatures and determining which T_mid value minimizes the fitting mean-squared error of CpoR.
  3. Assign a values to each partition by curve fitting to data in (1)

While this exhaustive approach will always give an answer, it is presumably not the most efficient (with respect to time and finding a global minimum). We also make assumptions that the first minimum in error encountered is the global minimum, which is not necessarily true. This approach becomes more inefficient for Nasa9 objects that can have an arbitrary number of T_mid values.

We have attempted to use scipy's minimize functions where step 2 no longer exhaustive. Surprisingly, we find this method is ~50 times slower than the exhaustive method. This is likely due to the increased number of method calls for model.get_CpoR.

Since the error for the Nasa is not extremely sensitive to T_mid, we will favor the exhaustive method for now. However, I would still like to optimize this in the future.