I am trying to model a Li-Ion battery in Matlab. Even though I have read different articles on battery modelling, since I am a newbie, most of these articles seems complicated to me. Also, I have some conceptual issues with real time simulation, hence I need simple answers for a few question.
Firstly, I do not want to use Simulink and want to directly implement my model via coding on Matlab (like writing a function). Is it possible (ok, it is probably possible, but I am asking whether it is feasible compared to using Simulink)?
Secondly, I checked the Matlab generic battery model page on here. I got most of the idea, however I could not think of a way to realize the integral part. (I guess we are using integral for calculating the extracted capacity of the battery) Since this I am aiming to make real time simulation, I do not know the exact time when simulation starts and stops. Besides, I should be observing the results during the simulation.
Another question is that why are we using a low pass filter like given in this image? What is the purpose of filtering the current here?
Finally, as I mentioned above I want to implement my model as a function. Is there a way to implement my model without using equivalent circuit model? If there is no way around, how can i implement electrical components such as capacitor?
Thanks in advance.