I am looking for the optimal method to simulate the behavior of a lithium battery. I managed to implement part of Thevenin battery model in PSIM. I do not have licensed software such as mathlab or psim. Now I try to deduce the mathematical equation that describes a battery in order to use a programming language for simulation. Thank you for the help!