nikhilgupta10 / GridLAB-D

Other
1 stars 0 forks source link

#701 Collectors don't seem to like unit conversions, #2439

Closed nikhilgupta10 closed 7 years ago

nikhilgupta10 commented 7 years ago

If a different unit is specified on a collector's output (e.g., avg(air_temperature[degC]) in houses), the output is junk. Even on a single object it does this, so I'm not sure it is the aggregation. Brought up in forum post at: https://sourceforge.net/projects/gridlab-d/forums/forum/842562/topic/6718954.

Simple GLM, if you really need one:

clock {
    timezone PST+8PDT;
    starttime '2005-01-01 00:00:00 PST';
    stoptime '2005-01-05 00:00:00 PST';
};

module residential;
module tape;

object house {
} 

object collector {
    group \class=house\;
    property avg(air_temperature[degC]);
    file testout_degC.csv;
}

,

nikhilgupta10 commented 7 years ago

nikhilgupta10 imported these comments from Sourceforge: The user mhauer does not exist anymore. Therefore assigning this to afisher1. "jcfuller": * owner changed from jcfuller to mhauer

The problem stems from incorrect arithmetic being used for the converting the aggregate's answer from one unit to another, when a bias is included. Scalar unit conversion works correctly, tested going from ft2 to m2.

Solutions include converting every value to the 'new' unit prior to employing it in the aggregation, or extracting the bias and scalar for the conversion in lieu of running the conversion function itself.

,

"mhauer":r3866 adds a branch for this ticket, and includes a modified 2.3/core/aggregate.c that passes visual checks for converting degF to degC properly in collectors.
No autotest has been written for this yet. Aggregates are primarily used in collectors, which do not publish the aggregate's value, but write it out to a file. A new assert class may be needed.

,

"jcfuller":Status? Has this been merged into branch 2.3??

,

"andyfisher": * status changed from accepted to closed

,