simpleBattery¶
Executive Summary¶
The SimpleBattery class is a minimal model of battery functionality that considers:
Integrated net input power of the attached modules
2. The battery’s maximum storage capacity as defined by the storageCapacity
attribute.
Integration of the net input power is performed with a simple Euler method.
\(W_{stored} = \dot{W}_{net} (t_{current} - t_{previous})\)
Module Assumptions and Limitations¶
See powerStorageBase class for inherited assumption and limitations. The SimpleBattery class assumes that the net energy storage amount is a fixed value.
Message Connection Descriptions¶
This module only uses the input and output messages of the powerStorageBase base class.
User Guide¶
To set up this module users must create a SimpleBattery instance:
battery = simpleBattery.SimpleBattery()
battery.ModelTag = "batteryModel"
In addition to the variables that must be set for the powerStorageBase base class, this module requires the storageCapacity
attribute to be specified. The total power stored in the battery will be limited to not exceed this capacity value:
battery.storageCapacity = 10.0 # Given in Joules or Watt-seconds
The next step is to attach one or more powerNodeUsageSimMsg instances to it using the addNodeToStorage()
method:
battery.addPowerNodeToModel("msg name")
The final step is to specify the output message name:
battery.batPowerOutMsgName= "outMsgName"
For more information on how to set up and use this module, see the simple power system example scenarioSimplePowerDemo.
-
class
SimpleBattery
: public PowerStorageBase¶ Public Functions
-
SimpleBattery
()¶ The constructor creates a SimpleBattery instance with zero stored charge
-
~SimpleBattery
()¶
Public Members
-
double
storageCapacity
¶ [W-s] Battery capacity in Watt-seconds (Joules).
Private Functions
-
void
customReset
(uint64_t CurrentClock)¶ custom reset function.
-
void
evaluateBatteryModel
(PowerStorageStatusSimMsg *msg)¶ This method integrates the current net power, and checks to see whether the integrated power falls between 0 and the battery’s storageCapacity.
- Return
void
- Parameters
*msg
: pointer to a PowerStorageStatusSimMsg instance
-