rl-institut / spice_ev

Simulation Program for Individual Charging Events of Electric Vehicles
MIT License
21 stars 9 forks source link

fix battery problems at CC boundaries #180

Closed stefansc1 closed 10 months ago

stefansc1 commented 10 months ago

In certain cases, the battery Soc approached the charging curve boundary without being able to surpass it (floating point arithmetic). Changed: take next interval if SoC is already close to next boundary, stop charging if SoC is close to target (in both cases compare with EPS instead of 0). Added assertion that energy delta is greater than 0 (something happens in the battery, no infinite loop)