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
| Equation | Condition |
|---|---|
| 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
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.Efficiency | etaCha | 0.9 | Efficiency during charging |
| Modelica.Units.SI.Efficiency | etaDis | 0.9 | Efficiency during discharging |
| Real | SOC_start | 0.1 | Initial state of charge |
| Modelica.Units.SI.Energy | EMax | Maximum available charge |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput | P | ||
| Modelica.Blocks.Interfaces.RealOutput | SOC | State of charge |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.Power | PAct | Actual 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.