I have a computer simulation of a RE system, which I use to size and validate a system before it's built.
I use a simple battery model in it, treat the battery as a huge capacitor C plus internal resistance R, and calculate the charge Q accumulation (and SOC) using 1st-order linear differential/integral equations (Q = time integral of current flowing in/out).
Then, instead of using Q and C to calculate the battery voltage V, I do Q-to-V mapping using a nonlinear function I picked up from some ieee proceedings paper.
Then, I calculate the energy stored in the battery using Q and V.
I have a feeling that treating a battery as a capacitor is not accurate, and that some fully-nonlinear model needs to be used to make the simulation more realistic.
Has anyone worked with battery models before, and can suggest something more realistic, but still easily implemented in a PC simulation?