Solar-inverter implementation help

  • Frank Tuffner

    Frank Tuffner - 2013-09-02

    Posting from thread:

    Moving here to help keep things a little cleaner.

    Original post by Fragkopoulos

    Hi again,

    I have the version 2.3.1. I thing that if I code as parent of object battery an object meter, GridLAB-d will consider that I am trying to run a DC network. My problem is that when I am using as a parent of object battery an inverter, gridlabd.exe file stop working.

    I try to put two different inverters, one for each component (battery and PV), to the same object meter but again gives me the message:gridlabd.exe file stop working.

    Do you have any suggestions ?

    Thank you again,


    • Frank Tuffner

      Frank Tuffner - 2013-09-02

      Hello Fragkopoulos,
      From your basic description, what you've implemented should work (aside from we really don't have the ability to implement "dc networks", as Jason indicated in an earlier post -- we just have connections to the AC side). However, the saying of "the devil is in the details" is likely very relevant here. You mention that gridlabd.exe "stops working". Is there any more detail to the error message? Can you post a small subset of your code with the meter, two inverters, battery, and solar object? It's possible you just have something implemented in a non-standard way.

      On a possibly related note, how did you go about upgrading to GridLAB-D 2.3.1? If you didn't uninstall the previous version you had, it may being cross-linked with version 2.2, which can cause all sorts of weird behavior. I just wanted to make sure we aren't chasing down the wrong problem before getting too far into the solar/inverter/meter objects.


  • Jason Fuller

    Jason Fuller - 2013-09-02


    Good and bad. Fortunately, I can see the problem (in the GLD code) that you are having - there is a missing call to pointer that is needed when the battery is connected to an inverter. Unfortunately, there's not really a good way to fix it without completely re-releasing the code (which we are not planning to do for v2.3.1).

    A couple of work-arounds are possible:
    1) Upgrade to v3.0. The pointer that is missing is no longer used in this version.
    2) Attach your battery object directly to the meter.

    Version 3.0 will be available by the end of September. To use (2), it is relativley simple. Instead of childing the battery to the inverter, just change to parent to the meter:

    object battery {
        name inv_1_bat;
        parent meter1;  // <------------
        generator_mode CONSTANT_PQ;
        V_Max 400;
        I_Max 50;
        P_Max 20000;
        E_Max 4000000;
        generator_status ONLINE;
        Energy 4000000;
        power_type DC;
        base_efficiency 0.86;
        power_factor 1.0;

    This seems a little odd, but it assumes a battery-inverter unit, rather than two independent objects. The efficiency is then representative of the entire ensemble.

    I hope that helps and I apologize about the bug - like I said, we'll have it removed for the next release.

  • Fragkopoulos

    Fragkopoulos - 2013-09-02


    If I attach the battery directly to the meter it works and it gives me some results. The point is that battery is a DC component, and the whole network supports AC. In my point of view this is unlikely to occur.

    I observe some change in voltages when I connect batteries directly to the meters but still I am not sure about the accuracy. Please if I misunderstood anything, let me know.

    Thanks again,


  • Jason Fuller

    Jason Fuller - 2013-09-03


    As I mentioned before, GridLAB-D is not designed to represent the DC powerflow, but rather the contribution of the DC components to the AC network. The battery/inverter are modeled as a single unit in this case, i.e., inside the model, the battery to inverter connection is assumed to be maximum power point tracking. During steady-state, from the point-of-view of the AC network, the battery/inverter is just a voltage dependent current injection.

    Depending on what effects you are trying to model/study, this representation is more than accurate. If you are looking at the network efficiencies of, let's say, impedance matching of inverters to solar panels, then this isn't the right tool. If you are looking at, let's say, how an inverter/battery pair might affect the voltage control on the distribution network, this is probably overly accurate. Again, it just depends on what your interests are.



Log in to post a comment.