示例#1
0
文件: radau5.py 项目: apetcho/odespy
    def validate_data(self):
        # lower- & upper-bound for banded Jacobian in range [0, neq]
        for name in ('ml', 'mu', 'mlmas', 'mumas'):
            if hasattr(self, name):
                self._parameters[name]['range'] = (0, self.neq+1)

        has_banded_jac = hasattr(self, 'jac_banded')
        ml, mu = getattr(self, 'ml', None), getattr(self, 'mu', None)
        if has_banded_jac and ((ml is None) or (mu is None)):
            raise ValueError('"ml" and "mu" have to be provided when banded Jacobian matrix is involved! Your input is (%s, %s).' % (ml, mu))
        return Solver.validate_data(self)
示例#2
0
文件: radau5.py 项目: zcemycl/odespy
    def validate_data(self):
        # lower- & upper-bound for banded Jacobian in range [0, neq]
        for name in ('ml', 'mu', 'mlmas', 'mumas'):
            if hasattr(self, name):
                self._parameters[name]['range'] = (0, self.neq + 1)

        has_banded_jac = hasattr(self, 'jac_banded')
        ml, mu = getattr(self, 'ml', None), getattr(self, 'mu', None)
        if has_banded_jac and ((ml is None) or (mu is None)):
            raise ValueError(
                '"ml" and "mu" have to be provided when banded Jacobian matrix is involved! Your input is (%s, %s).'
                % (ml, mu))
        return Solver.validate_data(self)