Menu

#659 Suggested Matlab link upgrades

Version 4.0 RC1
accepted
None
none
none
minor
trunk
enhancement
2016-08-07
2012-12-13
No

1) Add a "valid_to" ability to the model. Currently, it re-synchronizes with Matlab every time there is a new iteration or sync call...this can be a massive transfer of data that's not necessary and slows the simulation. Suggest a "valid_to" feature, maybe be making the Matlab link an "object", that disconnects Matlab and GLD for a given amount of time.

2) A list / grouping function would be handy, i.e., I want the cooling setpoint for every house on groupid feeder1. This will be helpful for global optimization scenarios.

3) Convert the current GLM syntax to something more inline with other GLM syntax. Specifically, the Matlab link is looking for a single line of code up to 1024 characters long, without carriage returns. Suggest making it more flexible, maybe use object syntax {} to define start and finish of code.

4) Currently debug or display options in the Matlab code do not get displayed, i.e., passed from the Matlab code out to the command line. Makes it very difficult to debug. I imagine this is a setting in activating the Matlab command window, but unsure.

Discussion

  • David P. Chassin

    • status changed from new to assigned
     
  • David P. Chassin

    • milestone changed from Version 3.0 RC 1 to Unscheduled
     
  • David P. Chassin

    Item (1) can be implemented by add the following variables to '''glxlink''' in core/link.h:

      #define LF_SKIPSAFE 0x01
      int flags;
      TIMESTAMP valid_to;
      TIMESTAMP last_t;
    

    Add the following declaration at the top of glxmatlab/matlab.cpp:

      int global_skipsafe = 0;
    

    Add the following into the if-else-if sequence in '''matlab_settag''' in glxmatlab/matlab.cpp:

      else if ( strcmp(tag,"skipsafe")==0 )
      {
        if ( strcmp(data,"yes")==0 )
        {
          mod->flags |= LF_SKIPSAFE;
          char buf[1024];
          if ( gl_global_getvar("skipsafe",buffer,sizeof(buffer))
            global_skipsafe = atoi(buf);
        }
        else if ( strcmp(data,"no")==0 ) // this is the default value
          mod->flags &= ~LF_SKIPSAFE;
        else
          gl_error("skipsafe value '%s' is not valid", data);
      }
    

    Add the following to the end of '''glx_init''':

      mod->last_t = gl_globalclock;
    

    Add the following to '''glx_sync''' in glxmatlab/matlab.cpp before matlab_exec() call:

        TIMESTAMP effective_valid_to = min(mod->last_t+global_skipsafe,mod->valid_to);
        if ( global_skipsafe>0 && (mod->flags&LF_SKIPSAFE) && t1<effective_valid_to )
          return effective_valid_to;
        else
          last_t - t1;
    
     
  • David P. Chassin

    • Description has changed:

    Diff:

    
    
    • assigned_to: David P. Chassin --> Jason Fuller
    • Resolution: --> none
    • Component: Unknown --> none
     
  • David P. Chassin

    • status: assigned --> accepted
    • assigned_to: Jason Fuller --> David P. Chassin
    • Milestone: Unscheduled --> Knothole Interim
     
  • Andy Fisher

    Andy Fisher - 2016-06-24

    valid_to has been successfully added to trunk in r5360. Has any work been done on tasks 2-4? If not then we can don't have to do a diff on this ticket. otherwise we will.

     
  • David P. Chassin

    Items 2-4 have not been addressed as far as I know.

     
  • Andy Fisher

    Andy Fisher - 2016-06-24

    Thanks Dave. I'll mark the branch for deletion. We'll keep the ticket open of course.

     
  • David P. Chassin

    Postponing to future milestone.

     
  • David P. Chassin

    • Milestone: Knothole Interim --> Version 4.0 RC1