modelCharge

Model to compute the battery charge

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Information

This model represents the charge/discharge mechanism of a battery.

This model two parameters ηCHA and ηDIS that represent the efficiency during the charge and discharge of the battery.

The model given the power P that should be provide or taken from the battery and compute the actual power flowing through the battery as

EquationCondition
Pactual = P ηCHA P ≥ 0
Pactual = P / ηDIS P < 0

The actual power is then used to compute the variation of the state of charge SOC. The state of charge is the state variable of this model and is a real value between 0 and 1.

d SOC / dt = Pactual

Note:The input power P has to be controlled in order to avoid the state of charge SOC exceeding the range between 0 and 1.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.EfficiencyetaCha0.9Efficiency during charging
Modelica.Units.SI.EfficiencyetaDis0.9Efficiency during discharging
RealSOC_start0.1Initial state of charge
Modelica.Units.SI.EnergyEMaxMaximum available charge

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputP
Modelica.Blocks.Interfaces.RealOutputSOCState of charge

Components

TypeNameDefaultDescription
Modelica.Units.SI.PowerPActActual power

Revisions

  • August 26, 2022, by Jianjun Hu:
    Corrected calculation of power taken from the battery when it is discharged.
    This is for issue 3095.
  • December 6, 2021, by Michael Wetter:
    Corrected wrong unit string.
    This is for issue 2798.
  • June 2, 2014, by Marco Bonvini:
    Revised documentation.