modelBattery

Simple model of a battery

Information

Simple model of a battery.

This model takes as an input the power that should be stored in the battery (if P > 0) or that should be extracted from the battery. The model uses a fictitious conductance (see Buildings.Electrical.DC.Loads.Conductor) G such that P = u   i and i = u   G, where u is the voltage difference across the pins and i is the current at the positive pin.

The output connector SOC is the state of charge of the battery. This model does not enforce that the state of charge is between zero and one. However, each time the state of charge crosses zero or one, a warning will be written to the simulation log file. The model also does not limit the current through the battery. The user should provide a control so that only a reasonable amount of power is exchanged, and that the state of charge remains between zero and one.

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
Modelica.Units.SI.VoltageV_nominalNominal voltage (V_nominal >= 0)

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputPPower stored in battery (if positive), or extracted from battery (if negative)
Modelica.Blocks.Interfaces.RealOutputSOCState of charge
Buildings.Electrical.DC.Interfaces.Terminal_pterminalGeneralized terminal

Revisions

  • December 6, 2021, by Michael Wetter:
    Corrected wrong unit string.
    This is for issue 2798.
  • September 24, 2015 by Michael Wetter:
    Removed binding of P_nominal as this parameter is disabled and assigned a value in the initial equation section. This is for issue 426.
  • March 19, 2015, by Michael Wetter:
    Removed redeclaration of phase system in Terminal_n and Terminal_p as it is already declared to the be the same phase system, and it is not declared to be replaceable. This avoids a translation error in OpenModelica.
  • June 2, 2014, by Marco Bonvini:
    Revised documentation.
  • January 8, 2013, by Michael Wetter:
    First implementation.