code: def check_limit(self, varname, vmin=None, vmax=None):
          
          retval = True
          assert varname in self.__dict__
  
          if varname in self._algebs:
              val = self.system.dae.y[self.__dict__[varname]]
          elif varname in self._states:
              val = self.system.dae.x[self.__dict__[varname]]
          else:  # service or temporary variable
              val = matrix(self.__dict__[varname])
  
          vmin = matrix(self.__dict__[vmin])
          comp = altb(val, vmin)
          comp = mul(self.u, comp)
          for c, n, idx in zip(comp, self.name, range(self.n)):
              if c == 1:
                  v = val[idx]
                  vm = vmin[idx]
                  self.log(
                      'Init of <{}.{}>={:.4g} is lower than min={:6.4g}'.format(
                          n, varname, v, vm), ERROR)
                  retval = False
  
          vmax = matrix(self.__dict__[vmax])
          comp = agtb(val, vmax)
          comp = mul(self.u, comp)
          for c, n, idx in zip(comp, self.name, range(self.n)):
              if c == 1:
                  v = val[idx]
                  vm = vmax[idx]
                  self.log(
                      'Init of <{}.{}>={:.4g} is higher than max={:.4g}'.format(
                          n, varname, v, vm), ERROR)
                  retval = False
          return retval
docs: Check if the variable values are within the limits.
  
          Return False if fails.