Applied current [A] - function of time #3863
-
I am working on an extension of the half cell example case, including some gas generation reactions. I now have a stable code and I wish to include some battery cycling in this simulation. param = pybamm.ParameterValues( In this environment, is it possible to replace the constant value of current with a variable current as a function of pybamm.t? and use "i" as an input. But I get the following error: Any suggestions? Need not be a direct one, I need a simple way to finish charging cycle and use the solution as an initialization for discharge. At the moment, I am result oriented so not looking for pretty solutions. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Try something like |
Beta Was this translation helpful? Give feedback.
-
@tinosulzer That was helpful. Thanks and good to know that the experiment class will be extended to any models. For a beginner like me, it is much easier to play around with the BaseModel(), so I am happy about this. |
Beta Was this translation helpful? Give feedback.
-
@valentinsulzer I have a follow up on the same topic - just avoiding the opening of a new discussion. As an extension, I wish to do the applied current based on a voltage cut off: Basically, charge until a certain voltage is reached and then discharge. Following is my attempt: BV=pybamm.boundary_value(phi_p, "right")-pybamm.boundary_value(phi_n, "left") I am getting the following error and I get the domain mismatch error: The reason for this error : The boundary condition for the positive electrode is I_app/A/sigma_p. From the above 3 lines, I think the Battery voltage calcualtion (BV) is function of positive domain and negative domain, and since this is used in the boolean operation in "i_applied", I am getting the domain error. Please correct me if I am wrong? While I understand this part, I am afraid I have no clue on how to fix this. Any suggestions? |
Beta Was this translation helpful? Give feedback.
Try something like
i = (pybamm.t < 3600) * (-5) + (pybamm.t >= 3600) * (pybamm.t < 7200) * 5
That would be 1h 1C charge followed by 1h 1C charge for a 5 Ah cell.
Also, we are aiming to have experiments work with any model in the next release