Modelica.Electrical.Batteries.Examples

Collection of battery examples

Information

Collection of examples demonstrating the usage of the battery models without and with sensors.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Modelica.Electrical.Batteries.Examples.BatteryDischargeCharge BatteryDischargeCharge Discharge and charge idealized battery
Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge SuperCapDischargeCharge Discharge and charge idealized supercap
Modelica.Electrical.Batteries.Examples.CCCVcharging CCCVcharging Charge a battery with constant current - constant voltage characteristic
Modelica.Electrical.Batteries.Examples.CCCV_Cell CCCV_Cell Charge a cell with constant current - constant voltage characteristic
Modelica.Electrical.Batteries.Examples.CCCV_CellRC CCCV_CellRC Charge a transient cell with constant current - constant voltage characteristic
Modelica.Electrical.Batteries.Examples.CCCV_Stack CCCV_Stack Charge a stack with constant current - constant voltage characteristic
Modelica.Electrical.Batteries.Examples.CCCV_StackRC CCCV_StackRC Charge a transient stack with constant current - constant voltage characteristic
Modelica.Electrical.Batteries.Examples.ShowImpedance ShowImpedance Show complex cell impedance

Modelica.Electrical.Batteries.Examples.BatteryDischargeCharge Modelica.Electrical.Batteries.Examples.BatteryDischargeCharge

Discharge and charge idealized battery

Information

Two batteries with a nominal charge of 10 A.h starting with an initial SOC = 95 % are compared:

Two parameter records cellData1 and cellData2 are used to parameterize the battery models.

First the batteries are discharged with 7 current pulses of 50 A for 1 minute, and breaks between the pulses of 1 minute, ending at SOC = 5 %.
Subsequently, the batteries are charged again with 7 current pulses of 50 A for 1 minute, and breaks between the pulses of 1 minute, ending at SOC = 95 % again.
In the end, the batteries are in no-load condition to reveal self-discharge effects. Note that self-discharge of battery2 is set to an unrealistic high value, to show self-discharge within a rather short time span.
The parameters of the RC-elements of battery2 are set to estimated values, just to demonstrate the effects.

Simulate and plot terminal voltage battery1.v and battery2.v as well as state of charge battery1.SOC and battery2.SOC.

Plotting energy1.y and energy2.y, it is remarkable that first energy is delivered by the battery, but then due to the losses more energy is consumed to recharge the battery.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
cellData1 
cellData2 

Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge

Discharge and charge idealized supercap

Information

A supercap with a capacitance of 500 F, starting initially at nominal voltage 48 V, is discharged with 5 current pulses of 240 A for 10 seconds, and breaks between the pulses of 10 seconds. Subsequently, the supercap is charged again with 5 current pulses of 240 A for 10 seconds, and breaks between the pulses of 10 seconds. In the end, the supercap is in no-load condition to reveal self-discharge effects.

Note that self-discharge is set to an unrealistic high value, to show self-discharge within a rather short time span.
The other parameters of the supercap is set to estimated but realistic values:

Simulate and plot terminal voltage supercap.v.

Plotting energy.y, it is remarkable that first energy is delivered by the supercap, but then due to the losses more energy is consumed to recharge the supercap.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica.Electrical.Batteries.Examples.CCCVcharging Modelica.Electrical.Batteries.Examples.CCCVcharging

Charge a battery with constant current - constant voltage characteristic

Information

A battery depleted to SOC = 0.1 is recharged with a CC-CV charger. Charging current in CC mode is 5C which means the battery is theoretically nearly fulled charged after 0.9*3600 s/5 = 648 s and the charger switches to CV mode.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
cellData 

Modelica.Electrical.Batteries.Examples.CCCV_Cell Modelica.Electrical.Batteries.Examples.CCCV_Cell

Charge a cell with constant current - constant voltage characteristic

Information

A single cell depleted to SOC = 0.1 is recharged with a CC-CV charger. Charging current in CC mode is 5C which means the battery is theoretically nearly fulled charged after 0.9*3600 s/5 = 648 s and the charger switches to CV mode. Simulate for 1200 s and plot cell.cellBus.soc versus time.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
cellDataCell data

Modelica.Electrical.Batteries.Examples.CCCV_CellRC Modelica.Electrical.Batteries.Examples.CCCV_CellRC

Charge a transient cell with constant current - constant voltage characteristic

Information

A single transient cell depleted to SOC = 0.1 is recharged with a CC-CV charger. Charging current in CC mode is 5C which means the battery is theoretically nearly fulled charged after 0.9*3600 s/5 = 648 s and the charger switches to CV mode. Simulate for 1200 s and plot cell.cellBus.soc versus time.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
cellDataCell data

Modelica.Electrical.Batteries.Examples.CCCV_Stack Modelica.Electrical.Batteries.Examples.CCCV_Stack

Charge a stack with constant current - constant voltage characteristic

Information

A stack of cells with one degraded cell (with indices [1,1], with double inner resistance), all cells depleted to SOC = 0.1, is recharged with a CC-CV charger. Simulate for 1200 s and plot versus time:

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
cellDataOriginalOriginal cell data
cellDataDegradedDegraded cell data
stackDataStack data

Modelica.Electrical.Batteries.Examples.CCCV_StackRC Modelica.Electrical.Batteries.Examples.CCCV_StackRC

Charge a transient stack with constant current - constant voltage characteristic

Information

A stack of transient cells with one degraded cell (with indices [1,1], with double inner resistance), all cells depleted to SOC = 0.1, is recharged with a CC-CV charger. Simulate for 1200 s and plot versus time:

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
cellDataOriginalOriginal cell data
cellDataDegradedDegraded cell data
stackDataStack data

Modelica.Electrical.Batteries.Examples.ShowImpedance Modelica.Electrical.Batteries.Examples.ShowImpedance

Show complex cell impedance

Information

Plot impedance.z.im versus impedance.z.re

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

NameDescription
cellData 
Automatically generated Thu Oct 1 16:07:40 2020.