modelBattery

Simple model of a battery

Extends from Buildings.Electrical.Interfaces.PartialAcDcParameters (Partial model that contains basic parameters for a DC/AC conversion system).

Information

Simple model of a battery.

This model takes as an input the power to be extracted from the AC line and stored in the battery (if P > 0) or to be fed into the AC line after being extracted from the battery. The actual power stored or extracted in the battery differs from P due to AC/DC conversion losses and battery charge and discharge efficiencies.

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_startInitial charge
Modelica.Units.SI.EnergyEMaxMaximum available charge
Modelica.Units.SI.VoltageV_nominalNominal voltage (V_nominal >= 0)
BooleanlinearizedfalseIf =true introduce a linearization in the load
AC-Conversion
Realpf (from PartialAcDcParameters)0.9Power factor
Realeta_DCAC (from PartialAcDcParameters)0.9Efficiency of DC/AC conversion
Initialization
Buildings.Electrical.Types.InitModeinitModeBuildings.Electrical.Types.InitMode.zero_currentInitialization mode for homotopy operator

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.AC.OnePhase.Interfaces.Terminal_pterminalGeneralized terminal

Contents

NameDescription
PhaseSystem

Revisions

  • December 6, 2021, by Michael Wetter:
    Corrected wrong unit string.
    This is for issue 2798.
  • April 2, 2020 by Michael Wetter:
    Corrected model and improved the documentation. The previous model extracted from the AC connector the input power P plus the AC/DC conversion losses, but P should be the power exchanged at the AC connector. Conversion losses are now only accounted for in the energy exchange at the battery.
    This is for issue 1865.
  • 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.
  • September 4, 2014, by Michael Wetter:
    Corrected problem, the losses due to AC/DC conversion have to affect both during the charge and the discharge. The input P is the power that is taken, due to conversions the actual power drain from the battery is higher.
  • September 4, 2014, by Michael Wetter:
    Revised model.
  • August 5, 2014, by Marco Bonvini:
    Revised documentation.
  • January 8, 2013, by Michael Wetter:
    First implementation.