def test_sin(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.sin(xl, xu)
                 x = np.linspace(xl, xu, 100)
                 _z = np.sin(x)
                 self.assertTrue(np.all(zl <= _z))
                 self.assertTrue(np.all(zu >= _z))
Exemple #2
0
 def test_sin(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.sin(xl, xu)
                 x = np.linspace(xl, xu, 100)
                 _z = np.sin(x)
                 self.assertTrue(np.all(zl <= _z))
                 self.assertTrue(np.all(zu >= _z))
Exemple #3
0
def _prop_bnds_leaf_to_root_sin(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.sin(lb1, ub1)
Exemple #4
0
def _prop_bnds_leaf_to_root_sin(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.sin(lb1, ub1)
Exemple #5
0
def _prop_bnds_root_to_leaf_asin(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.sin(lb0, ub0)
    if _lb1 > lb1:
        lb1 = _lb1
    if _ub1 < ub1:
        ub1 = _ub1
    bnds_dict[arg] = (lb1, ub1)
Exemple #6
0
def _prop_bnds_root_to_leaf_asin(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.sin(lb0, ub0)
    if _lb1 > lb1:
        lb1 = _lb1
    if _ub1 < ub1:
        ub1 = _ub1
    bnds_dict[arg] = (lb1, ub1)