def _constructControl(self,model,controlNames,binaryPrefix,controlValuePref,regPrefix,climits,zero):
        '''
        Create binary control variables
        
        one = off:
        if y = 0: low < v < high
        if y = 1: v = 0
        v + high*y <= high
        v + low*y >= low
        
        zero = off:
        if y = 1: 0 < v < d
        if y = 0: v = 0
        v - high*y <= 0
        v - low*y >= 0
        
        ==>
        for v in reaction targets
        pc: v - high*pc < 0
        nc: v - low* < 0
        
        '''
        
        binaryLimitName = "control_"
        
        posControlRow = regPrefix+"_pc_"
        negControlRow = regPrefix+"_nc_"

        jmodel = LinearModel()
        if zero:
            equation1 = "%s_pc_%s:%s + %s %s < 0" % (regPrefix,"%s",controlValuePref,-1.0*self.posControlBound,binaryPrefix)
            equation2 = "%s_nc_%s:%s + %s %s > 0" % (regPrefix,"%s",controlValuePref,-1.0*self.negControlBound,binaryPrefix)
        else:
            equation1 = "%s_pc_%s:%s + %s %s < %s" % (regPrefix,"%s",controlValuePref,self.posControlBound,binaryPrefix,self.posControlBound)
            equation2 = "%s_nc_%s:%s + %s %s > %s" % (regPrefix,"%s",controlValuePref,self.negControlBound,binaryPrefix,self.negControlBound)
            
        jmodel = self.parseEquations.applyRelation(jmodel,posControlRow,equation1,controlNames,prefixPattern="%s")
        jmodel = self.parseEquations.applyRelation(jmodel,negControlRow,equation2,controlNames,prefixPattern="%s")

        result = LinearModel()
        
        for columnName in controlNames:
            
                iCName = binaryPrefix + columnName
                iDName = controlValuePref + columnName
                
                posControlName = regPrefix + "_pc_" + columnName
                negControlName = regPrefix + "_nc_" + columnName
                
                if columnName in climits and False: # this method is currently broken
                    (negBound,posBound) = climits[columnName]
                    if negBound == None:
                        negBound = self.negControlBound
                    if posBound == None:
                        posBound = self.posControlBound
                else:
                    posBound = self.posControlBound
                    negBound = self.negControlBound
                
                '''
                y = 1: l < v < u
                '''
                if(zero):
                    result.addData(posControlName,iDName,1.0)
                    result.addData(negControlName,iDName,1.0)
                    
                    result.addData(posControlName,iCName,-posBound)
                    result.addData(negControlName,iCName,-negBound)
 
                    result.addRowLimit(posControlName,(None,0.0))
                    result.addRowLimit(negControlName,(0.0,None))
                    
                else:
                    result.addData(posControlName, iDName, 1.0)
                    result.addData(negControlName, iDName, 1.0)
                    
                    result.addData(posControlName, iCName, posBound)
                    result.addData(negControlName, iCName, negBound)
                
                    result.addRowLimit(posControlName,(None,posBound))
                    result.addRowLimit(negControlName,(negBound,None))
        
        jmodel.columnLimits = {}
        
        if not result == jmodel:
            #print "---------------------------------apply equation failure: control-----------------------------------------"
            #! currently apply version does not handleA a map/list of boundary values
            pass

        model.addConstraints(result)

        '''
        w is limit of controls
        y is actual control state variable
        w - y = 0 as starting state ie all controls default to 0
        sum w > control min
        sum w < control max 
        '''

        self.parseEquations.defaultLimit = (0.0,1.0)
        
        iCName = binaryPrefix
        iDName = controlValuePref
        rowName = "_rcr_" + binaryPrefix
        equation = "_rcr_%s:_rc_%s + -1.0 %s = 0" % (binaryPrefix+"%s",iCName,iCName)
        
        jmodel = LinearModel()
        jmodel = self.parseEquations.applyRelation(jmodel,rowName,equation,controlNames,prefixPattern="%s")
        jmodel.setMipColumnNames(controlNames,tag=iCName+"%s")
        self.parseEquations.defaultLimit = (None,None)
        
        result = LinearModel()
        
        for columnName in controlNames:
        
                iCName = binaryPrefix + columnName
                iDName = controlValuePref + columnName        

                result.setMipColumnName(iCName)
                    
                result.addColumnLimit(iCName,(0.0,1.0))
                
                result.addColumnLimit("_rc_" + iCName,(0.0,1.0))
                
                result.addData("_rcr_" + iCName, "_rc_" + iCName, 1.0)
                result.addData("_rcr_" + iCName, iCName, -1.0)
                result.addRowLimit("_rcr_" + iCName, (0.0,0.0))

        if not result == (jmodel):
            print "---------------------------------apply equation failure: control-----------------------------------------"
  

        for columnName in controlNames:
                
                iCName = binaryPrefix + columnName
                iDName = controlValuePref + columnName

                result.addData(binaryLimitName,"_rc_"+ iCName,1.0)
        
        #Limit on control variables        
        result.addRowLimit(binaryLimitName,(self.controlMin,self.controlMax))
        
        model.addConstraints(result)
            
        return model