-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
DAE solver for non-smooth currents #759
Comments
could we augment |
Good idea, so would the discontinuities be a list of variables for which to look out for discontinuities? Or do we analyse the input current (a parameter) before solving to identify discontinuities and then tell the model/solver about them before solving? |
I'm thinking that the user would manually specify where the discontinuities occur in time, based on the parameters of the model. Therefore discontinuities would be an expression that evaluates to the time when the discontinuity takes place. So, given a model that has parameter Then it would be easy for the solver to get the list of where discontinuities occur in time, and make sure that the integration is restarted at each discontinuous time-point |
Each event now needs 3 pieces of info, its name, expression and type (DISCONTINUITY or TERMINATION). I think this needs a separate class to encapsulate this (and provide some documentation). Implemented this as model.events = [
pybamm.Event("var1 = 1.5", pybamm.min(var1 - 1.5)),
pybamm.Event("var2 = 2.5", pybamm.min(var2 - 2.5)),
pybamm.Event("nonsmooth rate",
pybamm.Scalar(2.5),
pybamm.EventType.DISCONTINUITY
)
] |
Fix (at least one of the) DAE solvers to work when the input current is not smooth.
Hacky approach is to do step-by-step and match up discontinuities with steps, or try stepping the differential and algebraic equations separately
The text was updated successfully, but these errors were encountered: