modelBattery

Test model for battery

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

This model illustrates use of a battery connected to an DC voltage source and a constant load. The battery is charged every night at 23:00 until it is full. At 14:00, it is discharged until it is empty. This control is implemented using a finite state machine. The charging and discharging power is assumed to be controlled to a constant value of 10,000 Watts.

Components

TypeNameDefaultDescription
Buildings.Electrical.DC.Storage.BatterybatBattery
Buildings.Electrical.DC.Sources.ConstantVoltagesouVoltage source
Modelica.Electrical.Analog.Basic.Groundground
Buildings.Electrical.DC.Loads.ConductorloaElectrical load
Modelica.Blocks.Sources.Constantconst1Power consumption of the load
Modelica.Blocks.Sources.SampleTriggerstartCharge
Modelica.Blocks.Logical.GreaterEqualThresholdgreaterEqualThreshold
Modelica.Blocks.Sources.SampleTriggerstartDischarge
Modelica.Blocks.Logical.LessEqualThresholdlessEqualThreshold
Modelica.Blocks.Logical.SwitchchaSwiSwitch to charge battery
Modelica.Blocks.Logical.SwitchdisSwiSwitch to discharge battery
Modelica.Blocks.Sources.ConstantPChaCharging power
Modelica.Blocks.Sources.ConstantPOffOff power
Modelica.Blocks.Sources.ConstantPDisDischarging power
Modelica.Blocks.Math.Addadd
Buildings.Electrical.DC.Sensors.GeneralizedSensorpowSenPower sensor
Modelica.StateGraph.InitialStepoffOff state
Modelica.StateGraph.TransitionWithSignaltoOnTransition to on
Modelica.StateGraph.StepWithSignalchargeState to charge battery
Modelica.StateGraph.TransitionWithSignaltoHoldTransition to hold
Modelica.StateGraph.StepholdBattery charge is hold
Modelica.StateGraph.TransitionWithSignaltoDischargeTransition to discharge
Modelica.StateGraph.StepWithSignaldischargeState to discharge battery
Modelica.StateGraph.TransitionWithSignaltoOffTransition to off
Modelica.StateGraph.StateGraphRootstateGraphRoot

Revisions

  • April 6, 2016, by Michael Wetter:
    Replaced Modelica_StateGraph2 with Modelica.StateGraph. This is for issue 504.
  • January 10, 2013, by Michael Wetter:
    First implementation.