BaseModel and Events #3882
-
I wish to add events to my model which is part of the BaseModel class. I tried the following: model.events = [ ] here: BV is the Battery voltage and low_cutoff is the pybamm.Parameter () for lower cut off. When I run this code, I get the following error: Any suggestions to fix this ? THanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @veera-visw, you are getting this error as you still have |
Beta Was this translation helpful? Give feedback.
-
@martinjrobins Thanks for the reply. I assumed the same thing ! My code as such is quite dirty at the moment so let me clean it up and share it with you ASAP. Meanwhile, the general structure of my code looks something like this (not a fully working code, just a skeleton) model=pybamm.BaseModel() model.variables={ I dont think I am using the pybamm.Simulation() class rather directly using the solver.solve class (similar to the half cell example) |
Beta Was this translation helpful? Give feedback.
-
@martinjrobins Good catch!! I went through my code again and I had the model.events() after the process_model(model). Silly mistake. but seems to be fixed now :) |
Beta Was this translation helpful? Give feedback.
so you are not inserting the values in
param
into your model. The easiest way to do this is use thepybamm.Simulation
class like so:without the Simulation class, you can use the ParameterValues class directly: