Table of Contents

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, IPowerInterface
Inheritance
Battery
Implements

Constructors

Battery()

Default constructor

protected Battery()

Fields

CalendarLife

The Age of the battery in years for the State of Health calculation

[Unit("Years")]
[Range(0, 1.7976931348623157E+308)]
[Metadata(IsAdvanced = true)]
public double CalendarLife

Field Value

double

NominalTemperature

The Nominal Operating Temperature of the battery in Kelvin

[Unit(UnitType.KELVIN)]
[Range(0, 1.7976931348623157E+308)]
[Metadata(IsAdvanced = true)]
public double NominalTemperature

Field Value

double

Out_BatteryMsg

The battery message containing the current information of the storage unit

public BatteryMessage? Out_BatteryMsg

Field Value

BatteryMessage

StateOfHealthCalendarLifeWeight

The Calendar Life Weight for the State of Health calculation

[Unit(UnitType.NONE)]
[Metadata(IsAdvanced = true)]
[Range(0, 1)]
public double StateOfHealthCalendarLifeWeight

Field Value

double

StateOfHealthChargeRateWeight

The Charge Rate Weight for the State of Health calculation

[Unit(UnitType.NONE)]
[Metadata(IsAdvanced = true)]
[Range(0, 1)]
public double StateOfHealthChargeRateWeight

Field Value

double

StateOfHealthDepthOfDischargeWeight

The Depth of Discharge Weight for the State of Health calculation

[Unit(UnitType.NONE)]
[Metadata(IsAdvanced = true)]
[Range(0, 1)]
public double StateOfHealthDepthOfDischargeWeight

Field Value

double

StateOfHealthTemperatureWeight

The Temperature Weight for the State of Health calculation

[Unit(UnitType.NONE)]
[Metadata(IsAdvanced = true)]
[Range(0, 1)]
public double StateOfHealthTemperatureWeight

Field Value

double

Properties

Capacity

The true Capacity of the battery in Amp hours based on NominalCapacity and State of Health

[Unit("Ah")]
[Range(0, 1.7976931348623157E+308)]
[ReadOnly]
public double Capacity { get; }

Property Value

double

Charge

The current charge of the battery in Amp hours

[Unit("Ah")]
[ReadOnly]
public double Charge { get; }

Property Value

double

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

double

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

double

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

double

MaxChargeCurrent

The maximum current flow that can charge the storage unit. Note it doesn't limit the charge current.

[Unit(UnitType.AMPERE)]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double MaxChargeCurrent { get; set; }

Property Value

double

MaxDischargeCurrent

The maximum current flow that leave the storage unit. Note it doesn't limit the discharge current.

[Unit(UnitType.AMPERE)]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double MaxDischargeCurrent { get; set; }

Property Value

double

NominalCapacity

The NominalCapacity of the storage unit in amp-hours.

[Unit("Ah")]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double NominalCapacity { get; set; }

Property Value

double

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

double

StateOfHealth

The State of Health of the battery, a value between 0 and 1.

[Unit(UnitType.NONE)]
[ReadOnly]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_BatteryMsg")]
public double StateOfHealth { get; }

Property Value

double

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

double

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

double

Methods

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)

Parameters

time double

[s] Current time of the simulation before the update

step double

[s] The time-step to update during this tick