Menu

#781 player variable ignores imaginary part

Version 4.0 RC1
unassigned
none
tape
major
2.3
enhancement
2014-06-24
2013-10-01
No

I'd like to use a player in the following way, similar to the example in the wiki. (except that I define 'value' as complex , not as double)
http://sourceforge.net/apps/mediawiki/gridlab-d/index.php?title=Player

module tape;
module powerflow;

clock {
    timezone GMT0+1;
    starttime '2012-12-19 11:00:00';
    stoptime '2012-12-19 11:59:59';
}

class player {
    complex value; // define variable
}

...

object load {
    name load1;
    parent meter1;
    phases "ABCN";
    constant_power_A s1H.value*1.0133;
    constant_power_B s2H.value*1.0064;
    constant_power_C s3H.value*1.0095;
    nominal_voltage 230V;
}

...

object player {
    name s1H;
    file Haus_s1_H1_2012121911.csv;
};
object player {
    name s2H;
    file Haus_s2_H1_2012121911.csv;
};
object player {
    name s3H;
    file Haus_s3_H1_2012121911.csv;
};

In the csv files all values are complex, but the player only uses the real part. This can be observed by a recorder on meter1:measured_power_A

I consider this a bug.

Discussion

  • Alain Brenzikofer

    This however works like it should:

    object load {
        name load1;
        parent meter1;
        phases "ABCN";
    
        object player {
            property constant_power_A;
            file Haus_s1_H1_2012121911.csv;
        };
        object player {
            property constant_power_B;
            file Haus_s2_H1_2012121911.csv;
        };
        object player {
            property constant_power_C;
            file Haus_s3_H1_2012121911.csv;
        };
        nominal_voltage 230V;
    }
    

    But this way I can't do gain correction.

     
  • Jason Fuller

    Jason Fuller - 2013-10-01
    • type changed from defect to enhancement
    • milestone changed from Unscheduled to Version 4.0 RC1

    Brenzikofer,

    Recommend posting this to the forums. This was discussed somewhat at:

    http://sourceforge.net/p/gridlab-d/discussion/842561/thread/f51cb19e/?limit=25#75b3

    among other forum posts. The player transform only supports the manipulation of double values (as they are inherent to C++), but there are ways to achieve what you are looking for - varying from accessing the real and imaginary portions individually to runtime code.

     
  • Jason Fuller

    Jason Fuller - 2014-06-24
    • Description has changed:

    Diff:

    
    
    • status: new --> unassigned
    • Resolution: --> none
    • Component: Tape --> tape
    • Priority: minor --> major