Class in Zendir.Classes | Inherits from PhysicalObject

Declaration

class Battery;

Description

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.


Properties

DeclaredDescription
CalendarLifeThe Age of the battery in years for the State of Health calculation
CapacityThe true Capacity of the battery in Amp hours based on NominalCapacity and State of Health
ChargeThe current charge of the battery in Amp hours
ChargeEfficiencyCharging efficiency factor (eta). Applied when current flows into the battery.Typical values are 0.9-1.0 for Li-ion cells.
ChargeFractionA value between 0 and 1 for the fraction of charge stored.
CurrentInThe current coming in to the power model from the battery
CurrentOutThe current coming out of the power model from the battery
DischargeEfficiencyDischarging efficiency factor (eta). Applied when current flows out of the battery.Typical values are 0.95-1.0 for Li-ion cells.
IgnoreChargeFractionToggles if the ChargeFraction scales the Simulated Battery voltage.When true, only the Nominal Battery Voltage is used for the simulation.
MaxChargeCurrentThe maximum current flow that can charge the storage unit. Note it doesn’t limit the charge current.
MaxDischargeCurrentThe maximum current flow that leave the storage unit. Note it doesn’t limit the discharge current.
NetPowerNet power: a positive value is power supplied to the circuit; a negative value is power consumed from the circuit.
NominalCapacityThe NominalCapacity of the storage unit in amp-hours.
NominalTemperatureThe Nominal Operating Temperature of the battery in Kelvin
NominalVoltageThe desired voltage that is produced from this storage unit.
OCVCoefficientsPolynomial coefficients for the Open Circuit Voltage (OCV) curve as a function of SOC.OCV(SOC) = a + bSOC + cSOC^2 + … where coefficients are [a, b, c, …].When null or empty, falls back to linear model: NominalVoltage * SOC.Use SetOCVCoefficients, SetOCVCoefficient, RemoveOCVCoefficient, and ClearOCVCoefficients for REST API usage.
Out_BatteryMsgThe battery message containing the current information of thestorage unit
PolarizationCapacitancePolarization capacitance (C1) for the RC equivalent circuit model in Farads.Used to model transient voltage behavior. Set to 0 to disable.
PolarizationResistancePolarization resistance (R1) for the RC equivalent circuit model in Ohms.Used to model transient voltage behavior. Set to 0 to disable.
PolarizationVoltageCurrent polarization voltage (V_RC) from the RC equivalent circuit model.This is the voltage drop across the RC branch due to transient effects.
StateOfHealthThe State of Health of the battery, a value between 0 and 1.
StateOfHealthCalendarLifeWeightThe Calendar Life Weight for the State of Health calculation
StateOfHealthChargeRateWeightThe Charge Rate Weight for the State of Health calculation
StateOfHealthDepthOfDischargeWeightThe Depth of Discharge Weight for the State of Health calculation
StateOfHealthTemperatureWeightThe Temperature Weight for the State of Health calculation
TimeToRechargeThe estimated time in seconds until the battery is fully recharged (ChargeFraction = 1).Returns 0 if already full, or double.PositiveInfinity if not charging.
VoltageInThe voltage coming in to the power model from the battery
VoltageOutThe voltage coming out of the power model from the battery
InheritedDescription
BehavioursA collection of behaviours attached to this object.
CenterOfMassB_BThe center of mass of the component in respect to the body frame (B) of the component. This is isolated from anychildren and exists in isolation.
CenterOfMassDot_LB_BThe center of mass time-derivative of the component within its own local coordinates. This does not include anyof the sub-components and exists in isolation.
CenterOfMassDotB_BThe center of mass time-derivative of the component relative to the body frame (B). This does not include any ofthe sub-components and exists in isolation.
CenterOfMassL_LThe center of mass of the component within its own local coordinates. This does not include any of thesub-components and exists in isolation.
CenterOfMassPrime_LB_BThe center of mass general-derivative of the component within its own local coordinates. This does not includeany of the sub-components and exists in isolation.
CenterOfMassPrimeB_B[m/s] The center of mass general-derivative of the component relative to the body frame (B). This does notinclude any of the sub-components and exists in isolation.
ChildrenA collection of children attached to this object.
DCM_BNThe rotational DCM matrix between the body frame (B) at the top of this component chain and the inertial frame (N).
DCM_LBThe rotational DCM matrix between the component frame of this object (L) relative to the body frame (B).
DCM_LNThe DCM rotational matrix of the component relative to the inertial origin (N) of the world.
DCM_LPThe DCM matrix of the component in the parent’s frame (P), taken from the Component Transform (PL).
IsEnabledIs true if the object is currently enabled.
LocalForwardThe direction of the transform frame’s forward vector, which is along the Y axis.
LocalRightThe direction of the transform frame’s right vector, which is along the X axis.
LocalUpThe direction of the transform frame’s up vector, which is along the Z axis.
MassThe component mass defined in the object. This is independent of any parent or children objects and exists inisolation.
MassDotThe component mass time-derivative defined in the object. This is independent of any parent or children objectsand exists in isolation.
ModelsA collection of models attached to this object.
MomentOfInertia_LBThe moment of inertia of the component, measured at the local center of mass, represented with its own localcoordinates. This does not include any of the sub-components and exists in isolation.
MomentOfInertiaB_BThe moment of inertia of this component, measured in the body frame relative to the parented body. This isindependent of any children and exists in isolation.
MomentOfInertiaPrime_LBThe derivative of the moment of inertia of the component, measured at the local center of mass, represented withits own local coordinates. This does not include any of the sub-components and exists in isolation.
MomentOfInertiaPrimeB_BThe derivative of the moment of inertia of the component, represented in the body frame (B). This is independentand exists in isolation.
NameThe display name or tag of this object.
Out_ComponentMassMsgThe component mass message defines the set of mass properties and states of the system within this componentlocally. This is independent of any parent or children properties or objects.
Out_TransformMsgThis defines the base transform message that stores the state of the transform of this object.
ParentThe currently attached parent object (if any).
Position[m] The position of the object relative to the parent or to world origin, if no parent exists.
Position_BN_NThe position of the body (the root parent B) in the inertial frame relative to the inertial point (N).
Position_LB_BThe position of the component relative to the root object of this hierarchy. This is in the inertial frame and ifthe component is the root object, then there will be no position.
Position_LN_NThe position of the inertial world space. This position is derived from the world’s transform (N).
Position_LP_PThe position of the object relative to the parented object (P). If there is no parent object, then this will bein the inertial frame.
RootThe root object in the parent chain.
Rotation[-] The rotation of the object relative to the parent or to the world origin, if no parent exists.
Thermal[TEMPORARY] A reference to the thermal model that is attached to this object. This will allow the object to havethermal properties and be able to be used in thermal simulations.

Methods

DeclaredDescription
ClearOCVCoefficientsClears all OCV coefficients. The battery then uses the linear model: NominalVoltage * SOC. Stored as empty array for REST/serialization compatibility.
RemoveOCVCoefficientRemoves the OCV coefficient at the given index. If the last coefficient is removed, clears to linear model when empty.
SetOCVCoefficientSets the full OCV coefficient array. Pass null or empty to clear and use linear model. Cleared state is stored as an empty array for REST/serialization compatibility.
SetOCVCoefficientsSets the full OCV coefficient array. Pass null or empty to clear and use linear model. Cleared state is stored as an empty array for REST/serialization compatibility.
InheritedDescription
AddObjectReturns a new simulation object with the specified type.
AttachAttempts to attach this object to a new parent. This will only work if the current object is no parented to anyother object.
ContainsModelWithIDReturns true if an attached model satisfies the specified ID.
ContainsModelWithTypeReturns true if an attached model satisfies the specified type.
DetachThis is an action to detach the current object from its parent, if it exists and move it to another object or tojust exist within the simulation.
FindBehavioursWithTypeReturns all attached behaviours that satisfies the specified type.
FindBehaviourWithIDReturns an attached behaviour that satisfies the specified ID.
FindBehaviourWithTypeReturns an attached behaviour that satisfies the specified type.
FindChildrenWithTypeReturns all attached children that satisfies the specified type.
FindChildWithIDReturns an attached child that satisfies the specified ID.
FindChildWithTypeReturns an attached child that satisfies the specified type.
FindModelsWithTypeReturns all attached models that satisfies the specified type.
FindModelWithIDReturns an attached model that satisfies the specified ID.
FindModelWithTypeReturns an attached model that satisfies the specified type.
FindParentWithIDReturns an attached parent that satisfies the specified ID.
FindParentWithTypeReturns an attached parent that satisfies the specified type.
FindRootWithIDReturns a root object that satisfies the specified ID.
FindRootWithTypeReturns a root object that satisfies the specified type.
GetModelReturns a valid assigned model with the specified type.
GetWorldForward[DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED.
GetWorldRight[DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED.
GetWorldTransformReturns the world transform of the object which is relative to the parent. If no parent exists, this will be thetransform of the object in world space.
GetWorldUp[DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED.
ReadBodyTransformThis method will reset the dirty flag on the mass so that it has been read successfully and is valid.
SetWorldTransform[DEPRECATED] THIS FUNCTION WILL BE REMOVED AND SHOULD NOT BE USED.
UpdateMassPropertiesUpdates the mass properties of the current physical object at a particular time.