modelSimpleBattery

Simple battery based on block controller logic

Information

A simple, logical battery which stores and discharges electricity.


The input signal (W_setpoint) drives the battery attempt to charge or discharge.

- W_setpoint = Negative | Mode = Discharge (port.W = negative)

- W_setpoint = Positive | Mode = Charge (port.W = positive)

Parameters

TypeNameDefaultDescription
Modelica.Units.NonSI.Energy_Whcapacity_max100e6Maximum storage capacity
Modelica.Units.NonSI.Energy_Whcapacity_min0Minimum storage capacity
SI.PowerchargePower_maxModelica.Constants.infMaximum charge power
SI.PowerchargePower_min0Minimum charge power
SI.PowerdischargePower_maxModelica.Constants.infMaximum discharge power
SI.PowerdischargePower_min0Minimum discharge power
Modelica.Units.NonSI.Energy_Whcapacity_usablecapacity_max - capacity_minMaximum usable capacity
SI.EnergyE_startModelica.Units.Conversions.from_Wh(capacity_usable)*capacityFrac_start + E_minStart energy
SI.EnergyE_maxModelica.Units.Conversions.from_Wh(capacity_max)Maximum storable energy
SI.EnergyE_minModelica.Units.Conversions.from_Wh(capacity_min)Minimum storable energy
Initialization
SItf.NonDimcapacityFrac_start1.0Initial capacity as a fraction of usable capacity (capacity_max-capacity_min)

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputW_setpointDemanded power input/output
TRANSFORM.Electrical.Interfaces.ElectricalPowerPort_Flowport

Components

TypeNameDefaultDescription
SI.EnergyETotal energy stored
SI.PowerWCharge/discharge power
SI.FrequencyfElectrical frequency
Modelica.Blocks.Logical.GreaterThresholdgreaterThreshold
Modelica.Blocks.Logical.SwitchW_limitedCharge/discharge power after limiting operations
Modelica.Blocks.Logical.GreaterThresholdcharge_min_greater
Modelica.Blocks.Logical.LessEqualThresholdcharge_max_less
Modelica.Blocks.Logical.Switchcharge_switch
Modelica.Blocks.Sources.ConstantchargeZero
Modelica.Blocks.Logical.Switchcharge_max_switch
Modelica.Blocks.Sources.Constantcharge_max
Modelica.Blocks.Logical.GreaterThresholddischarge_min_greater
Modelica.Blocks.Logical.Switchdischarge_switch
Modelica.Blocks.Logical.LessEqualThresholddischarge_max_less
Modelica.Blocks.Logical.Switchdischarge_max_switch
Modelica.Blocks.Math.Absabs
Modelica.Blocks.Sources.ConstantdischargeZero
Modelica.Blocks.Sources.Constantdischarge_max
Modelica.Blocks.Continuous.LimIntegratorE_totaltotal stored energy of battery