Skip to content

Commit 067eb7b

Browse files
committed
#759 add documentation to the heaviside function regarding discontinuities and how to handle them
1 parent 306b98e commit 067eb7b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pybamm/expression_tree/binary_operators.py

+11
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,17 @@ def inner(left, right):
644644
class Heaviside(BinaryOperator):
645645
"""A node in the expression tree representing a heaviside step function.
646646
647+
Adding this operation to the rhs or algebraic equations in a model can often cause a
648+
discontinuity in the solution. For the specific cases listed below, this will be
649+
automatically handled by the solver. In the general case, you can explicitly tell
650+
the solver of discontinuities by adding a :class:`Event` object with
651+
:class:`EventType` DISCONTINUITY to the model's list of events.
652+
653+
In the case where the Heaviside function is of the form `pybamm.t < x`, `pybamm.t <=
654+
x`, `x < pybamm.t`, or `x <= pybamm.t`, this DISCONTINUITY event will automatically
655+
be added by the solver.
656+
657+
647658
**Extends:** :class:`BinaryOperator`
648659
"""
649660

0 commit comments

Comments
 (0)