Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Jun 13, 2022
1 parent ba397ed commit 27f8cec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions pybamm/expression_tree/binary_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,10 @@ def _binary_new_copy(self, left, right):
"""See :meth:`pybamm.BinaryOperator._binary_new_copy()`."""
return pybamm.minimum(left, right)

def _sympy_operator(self, left, right):
"""Override :meth:`pybamm.BinaryOperator._sympy_operator`"""
return sympy.Min(left, right)


class Maximum(BinaryOperator):
"""Returns the greater of two objects."""
Expand Down Expand Up @@ -655,6 +659,10 @@ def _binary_new_copy(self, left, right):
"""See :meth:`pybamm.BinaryOperator._binary_new_copy()`."""
return pybamm.maximum(left, right)

def _sympy_operator(self, left, right):
"""Override :meth:`pybamm.BinaryOperator._sympy_operator`"""
return sympy.Max(left, right)


def simplify_elementwise_binary_broadcasts(left, right):
left, right = preprocess_binary(left, right)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, working_electrode, name="Electrode-specific SOH model"):
x_100_init = 0.85
# Make sure x_0 = x_100 - C/C_w > 0
C_init = param.Q
C_init = pybamm.minimum(Cw * x_100_init - 0.1, C_init)
C_init = pybamm.minimum(Cw * x_100_init, C_init)
self.initial_conditions = {x_100: x_100_init, C: C_init}

self.variables = {
Expand Down

0 comments on commit 27f8cec

Please sign in to comment.