Skip to content

Reimplement the Schwartz formula from the description Matt found

Sean Stangl requested to merge schwartz into master

This patch rewrites the Schwartz formula to match the published description that @photon_rain found in a magazine clipping. The location of that clipping needs to be added in a comment (PLUSA issue?).

Because Glossbrenner is defined in terms of Schwartz/Malone, updating Schwartz also affects Glossbrenner.

I added tests to verify the implementation against the coefficient tables published by tsampa.org and the APA-WPA website (the tables match). The final part of the piecewise function did not match the coefficient tables and was likely a typo -- 0.009 instead of 0.0009. Nevertheless it looks like Schwartz built his formula using pounds, and then attempted to convert it to kg for some reason, because the step is an exact value when you divide it by 2.20462262. So I reimplemented that section to match the tables.

Merge request reports