Пример #1
0
 def test_cos(self):
     lbs = np.linspace(-2 * math.pi, 2 * math.pi, 10)
     ubs = np.linspace(-2 * math.pi, 2 * math.pi, 10)
     for xl in lbs:
         for xu in ubs:
             if xu >= xl:
                 zl, zu = interval.cos(xl, xu)
                 x = np.linspace(xl, xu, 100)
                 _z = np.cos(x)
                 self.assertTrue(np.all(zl <= _z))
                 self.assertTrue(np.all(zu >= _z))
Пример #2
0
 def test_cos(self):
     lbs = np.linspace(-2*math.pi, 2*math.pi, 10)
     ubs = np.linspace(-2*math.pi, 2*math.pi, 10)
     for xl in lbs:
         for xu in ubs:
             if xu >= xl:
                 zl, zu = interval.cos(xl, xu)
                 x = np.linspace(xl, xu, 100)
                 _z = np.cos(x)
                 self.assertTrue(np.all(zl <= _z))
                 self.assertTrue(np.all(zu >= _z))
Пример #3
0
def _prop_bnds_leaf_to_root_cos(node, bnds_dict):
    """

    Parameters
    ----------
    node: pyomo.core.expr.expr_pyomo5.UnaryFunctionExpression
    bnds_dict: ComponentMap
    """
    assert len(node.args) == 1
    arg = node.args[0]
    lb1, ub1 = bnds_dict[arg]
    bnds_dict[node] = interval.cos(lb1, ub1)
Пример #4
0
def _prop_bnds_leaf_to_root_cos(node, bnds_dict):
    """

    Parameters
    ----------
    node: pyomo.core.expr.numeric_expr.UnaryFunctionExpression
    bnds_dict: ComponentMap
    """
    assert len(node.args) == 1
    arg = node.args[0]
    lb1, ub1 = bnds_dict[arg]
    bnds_dict[node] = interval.cos(lb1, ub1)
Пример #5
0
def _prop_bnds_root_to_leaf_acos(node, bnds_dict):
    """

    Parameters
    ----------
    node: pyomo.core.expr.expr_pyomo5.UnaryFunctionExpression
    bnds_dict: ComponentMap
    """
    assert len(node.args) == 1
    arg = node.args[0]
    lb0, ub0 = bnds_dict[node]
    lb1, ub1 = bnds_dict[arg]
    _lb1, _ub1 = interval.cos(lb0, ub0)
    if _lb1 > lb1:
        lb1 = _lb1
    if _ub1 < ub1:
        ub1 = _ub1
    bnds_dict[arg] = (lb1, ub1)
Пример #6
0
def _prop_bnds_root_to_leaf_acos(node, bnds_dict):
    """

    Parameters
    ----------
    node: pyomo.core.expr.numeric_expr.UnaryFunctionExpression
    bnds_dict: ComponentMap
    """
    assert len(node.args) == 1
    arg = node.args[0]
    lb0, ub0 = bnds_dict[node]
    lb1, ub1 = bnds_dict[arg]
    _lb1, _ub1 = interval.cos(lb0, ub0)
    if _lb1 > lb1:
        lb1 = _lb1
    if _ub1 < ub1:
        ub1 = _ub1
    bnds_dict[arg] = (lb1, ub1)