Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum/Maximum #735

Closed
valentinsulzer opened this issue Nov 15, 2019 · 0 comments · Fixed by #876
Closed

Minimum/Maximum #735

valentinsulzer opened this issue Nov 15, 2019 · 0 comments · Fixed by #876

Comments

@valentinsulzer
Copy link
Member

Add new binary operators that return the elementwise minimum / maximum values (e.g. pybamm.Minimum([1,2,3], 2) = [2,2,3]. Two options:

  1. Evaluate can be handled by np.minimum / np.maximum, and the derivative should be e.g. left.diff(var) * (left > right) + right.diff(var) * (left <= right) (easier but gives discontinuity of derivative at the switching point)
  2. Implement some kind of smooth transition between the two, e.g. based on this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant