Class Battery
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
[Nominal] A battery unit can be attached to a power circuit on an entity and is able to store power that can be both charged and discharged out of the system.
public class Battery : PhysicalObject
- Inheritance
-
Battery
Constructors
Battery()
Default constructor
protected Battery()
Fields
Out_BatteryMsg
The battery message containing the current information of the storage unit
public BatteryMessage? Out_BatteryMsg
Field Value
Properties
Capacity
Capacity of the storage unit in amp-hours.
[Unit("Ah")]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double Capacity { get; set; }
Property Value
Charge
The current charge of the battery in Amp hours
[Unit("Ah")]
[ReadOnly]
public double Charge { get; }
Property Value
ChargeFraction
A value between 0 and 1 for the fraction of charge stored.
[Unit(UnitType.NONE)]
[Range(0, 1)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double ChargeFraction { get; set; }
Property Value
CurrentIn
The current coming in to the power model from the battery
[Unit(UnitType.AMPERE)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double CurrentIn { get; }
Property Value
CurrentOut
The current coming out of the power model from the battery
[Unit(UnitType.AMPERE)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double CurrentOut { get; }
Property Value
MaxChargeRate
The maximum current flow that can charge the storage unit.
[Unit(UnitType.AMPERE)]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double MaxChargeRate { get; set; }
Property Value
MaxDischargeRate
The maximum current flow that leave the storage unit.
[Unit(UnitType.AMPERE)]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double MaxDischargeRate { get; set; }
Property Value
NominalVoltage
The desired voltage that is produced from this storage unit.
[Unit(UnitType.VOLT)]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double NominalVoltage { get; set; }
Property Value
PowerOut
The power coming out of the power model from the battery
[Unit(UnitType.WATT)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double PowerOut { get; }
Property Value
VoltageIn
The voltage coming in to the power model from the battery
[Unit(UnitType.VOLT)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double VoltageIn { get; }
Property Value
VoltageOut
The voltage coming out of the power model from the battery
[Unit(UnitType.VOLT)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double VoltageOut { get; }
Property Value
Methods
IsDischargeMaxReached()
Determines if the discharge rate has been reached and if so it will cap the current out at that rate.
public bool IsDischargeMaxReached()
Returns
- bool
A flag if the discharge limit is reached
OnCreate()
Called when the 'Component' is created from the controller.
protected override void OnCreate()
OnLoad(double)
Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.
protected override void OnLoad(double time)
Parameters
time
double[s] The current clock time of the simulation
OnUpdate(double, double)
Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.
protected override void OnUpdate(double time, double step)