How to use the gekko.gk_variable.GK_SV function in gekko

To help you get started, we’ve selected a few gekko examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BYU-PRISM / GEKKO / gekko / gk_variable.py View on Github external
self.STATUS = None
        self.TAU = None
        self.TIER = None
        self.TR_INIT = 0
        self.TR_OPEN = None
        self.VDVL = None
        self.VLACTION = None
        self.VLHI = None
        self.VLLO = None
        self.WMEAS = None
        self.WMODEL = None
        self.WSP = None
        self.WSPHI = None
        self.WSPLO = None

        GK_SV.__init__(self, name=name, value=value, lb=lb, ub=ub, gk_model=gk_model, model_path=model_path, integer=integer)
github BYU-PRISM / GEKKO / gekko / gekko.py View on Github external
def SV(self, value=None, lb=None, ub=None, integer=False, fixed_initial=True, name=None):
        """A variable that's special"""
        if name is not None:
            name = re.sub(r'\W+', '_', name).lower()
        else:
            name = 'v' + str(len(self._variables) + 1)
        if integer == True:
            name = 'int_'+name

        variable = GK_SV(name=name, value=value, lb=lb, ub=ub, gk_model=self._model_name, model_path=self._path, integer=integer)
        self._variables.append(variable)
        if fixed_initial is False:
            self.Connection(variable,'calculated',pos1=1,node1=1)
        return variable
github BYU-PRISM / GEKKO / gekko / gk_variable.py View on Github external
self.model_name = gk_model 
        self.path = model_path #use the same path as the model 
        
        # SV specific options
        self.FSTATUS = None
        self.LOWER = None
        self.MEAS = None
        self.MODEL = None
        self.PRED = None
        self.UPPER = None
        
        GKVariable.__init__(self, name, value, lb, ub, integer)

        

class GK_CV(GK_SV):
    """Controlled Variable. Inherits variable """
    
    def __init__(self, name='', value=0, lb=None, ub=None, gk_model=None, model_path=None, integer=False):

        # prevents the __setattr__ function from sending options to the server
        # until the __init__ function has completed since they should only be
        # sent if changed from their defaults
        self.__dict__['_initialized'] = False
        
        
        self.type = 'CV'
        
        # CV specific options
        self.BIAS = None
        self.COST = None
        self.CRITICAL = None