liionpack
liionpack copied to clipboard
power charging
Is there a specific reason why other than in PyBaMM there are only constant current operations are supported? in another word is there any way I can dis/charge power from/to battery? and is liionpack a suitable library for simulating the behavior of a bigger battery like a power bank?
No specific reason other than it hasn't been developed yet. liionpack is still pre-release. If you are interested in adding that functionality we can help and that would be great
@cyasing
@OlliRuokojoki
So I think we'd need to control power at the pack level and then work out the total pack voltage then divide power by this to get current and apply the single step currents as normal
Have to allow power control in protocols https://github.com/pybamm-team/liionpack/blob/develop/liionpack/protocols.py
It's used in the solver here https://github.com/pybamm-team/liionpack/blob/b1a1ddbc6f607f24b3f916b8cc68f4a17980cf2e/liionpack/solvers.py#L319
And here https://github.com/pybamm-team/liionpack/blob/b1a1ddbc6f607f24b3f916b8cc68f4a17980cf2e/liionpack/solvers.py#L425
Terminal voltage can be used to divide power to set terminal current. This is set here https://github.com/pybamm-team/liionpack/blob/b1a1ddbc6f607f24b3f916b8cc68f4a17980cf2e/liionpack/solvers.py#L431 I guess using the value from previous time step should work
@cyasing
Thank you.
Terminal voltage can be used to divide power to set terminal current. This is set here
https://github.com/pybamm-team/liionpack/blob/b1a1ddbc6f607f24b3f916b8cc68f4a17980cf2e/liionpack/solvers.py#L431
I guess using the value from previous time step should work
It looks like the terminal voltage is set after solving solve_circuit_vectorized(netlist)
in the function _step()
, which in itself requires current value I_map
to solve: https://github.com/pybamm-team/liionpack/blob/b1a1ddbc6f607f24b3f916b8cc68f4a17980cf2e/liionpack/solvers.py#L425
Power needs to be converted to current before that, doesn't it?
Yep you could loop in the initialisation step to get the right current
@cyasing I could work with you on this issue. Can I find you for example in the pybamm Slack channel so we could chat?
@cyasing I could work with you on this issue. Can I find you for example in the pybamm Slack channel so we could chat?
@OlliRuokojoki I don't have a slack account yet. I'll ask for an invitation.
Use this invite https://join.slack.com/t/pybamm/shared_invite/zt-1obrjh8fr-FKm~sT8693cZnAcim5dh~A
Use this invite https://join.slack.com/t/pybamm/shared_invite/zt-1obrjh8fr-FKm~sT8693cZnAcim5dh~A
Thanks!
Did you get something working for this? I ask because the script you use on the other issue uses power
Did you get something working for this? I ask because the script you use on the other issue uses power
I have added some code to convert power to current in the way you described, but getting that to test requires me to figure out the problem with the shifting solver, or at least the reason behind the capacity warning coming up in it. It's in a loop.
Is everything you are working on in a branch somewhere I can take a look at?
I had forked the repository, actually. It is here: https://github.com/cyasing/liionpack-power-trial.git . Do tell me if forking like this is not something I should do.
Hi, Is anyone still working on this? I'd really need this feature.
Hey @OlliRuokojoki - I made some changes to the vectorized circuit solve which iterates until a certain power is within tolerance. I haven't updated any solvers to accommodate this change yet but there is an example of how you would call this function. Do you think you can handle doing the rest? I don't have much time to work on this right now
FYI - there is a PyBaMM change to experiments coming in to the next release imminently so might make sense to wait for that https://github.com/pybamm-team/PyBaMM/pull/2960
Hi @TomTranter, I have now simplified my large battery pack to just a single large battery cell as basic PyBaMM works much better. I may just keep working on my simulation with the single cell to make the process a lot easier.
By the way does Liionpack support drive cycles? If I used drive cycles and current data I could get the results I'm looking for. At some lower and upper voltages I could stop the drive cycle, write new current data based on the new terminal voltage and then continue the drive cycle at the point it was interrupted by my voltage check. Do you think this approach is feasible with Liionpack?
Thanks for the help!
It does support drive cycles but stopping and re-starting simulations with old solution is not totally straight forward. Our plan is to merge liionpack into PyBaMM so the solvers and experiments will all work exactly the same in future. It's just quite a big job and other things have taken priority right now. If you can get the single PyBaMM model working for your needs I would stick with that