Closed HOLL95 closed 3 months ago
I managed to pin the error down to line 38. In particular, it seems that the order on how things are written matters, as this works
Eapp = E_start + \
(pybamm.t <= t_reverse) * Edc_forward + \
deltaE * pybamm.sin(omega * pybamm.t) + \
(pybamm.t > t_reverse) * Edc_backwards
I believe the issue is that the way the expression is simplified. It ends up wanting to substract two bools, which it doesn't like. If, instead, you substract a scalar from a bool, and then a bool from the result it works.
The suggestion above should fix your code, but I am curious about the signal you are trying to implement as it seems that the 2 boolean expressions cancel each other. What experiment are you trying to impose?
It looks like there hasn't been a reply in 30 days, so I'm closing this issue.
PyBaMM Version
24.1
Python Version
3.12
Describe the bug
Attempting to define a function in
rhs
using<
and>
operators results in the following errorremoving these operators removes the error; presumably they are causing the expression to be evaluated as a Boolean
Steps to Reproduce
Relevant log output
No response