Skip to content

Conversation

@chipbarnaby
Copy link
Contributor

Description

Modifications to built-in report generation machinery in cgresult.cpp provide support for double-precision data. The report scheme is table-driven with one row per report column. A new flag allows indicating that the data being accessed is double as opposed to float.

Improved generalized data access functions added to support that change.

Testing was performed by changing MTR end use data via conditional code controlled by METER_DBL (cndefns.h). Reported results were virtually identical to those with float data even for complex MTR schemes with submeters. METER_DBL left #undef'd but the conditional code retained for future experiments.

Test file submeter.cse updated to better test submeters with multipliers.

@chipbarnaby chipbarnaby requested a review from nealkruis July 10, 2023 15:07
*p dbl bt // battery output (negative)
*e dbl pv // photovoltaic array output (negative)
*e dbl allEU // subtotal, clg .. usr2 (= load w/o bt and pv)
#else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep Float around? Is there any reason not to remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MTR data are now float due to #undef METER_DBL. I decided not to code out the conditional code until some conclusion(s) are reached on double precision policy.

However, it is worth noting that changing MTR to double resulted in only infinitesimal changes in reported results, even for complicated situations involving may accumulating items and multiple submeters with multipliers. Anecdotally, that strongly indicates float is good enough for our S -> H -> D -> M -> Y accumulation scheme. So maybe the matter is settled for accumulation at least.

@nealkruis nealkruis merged commit 6fabc4d into main Jul 10, 2023
@nealkruis nealkruis deleted the double-report-data branch July 10, 2023 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants