Main Content

Battery Charging and Discharging

This example shows how to use a constant current and constant voltage algorithm to charge and discharge a battery. The Battery CC-CV block is charging and discharging the battery for 10 hours. The initial state-of-charge is equal to 0.3. When the battery is charging, the current is constant until the battery reaches the maximum voltage and the current decreases towards 0. When the battery is discharging, a constant current is used.

Model

Simulation Results

The plot below shows the current, voltage, and temperature of the battery under test.

Results from Real-Time Simulation

This example has been tested on a Speedgoat Performance real-time target machine with an Intel® 3.5 GHz i7 multi-core CPU. This model can run in real time with a step size of 50 microseconds.

See Also