ns-3
|
Model a generic Lithium Ion Battery basing on [1][2]. More...
#include <li-ion-energy-source.h>
Public Member Functions | |
virtual double | GetInitialEnergy (void) const |
void | SetInitialEnergy (double initialEnergyJ) |
virtual double | GetSupplyVoltage (void) const |
void | SetInitialSupplyVoltage (double supplyVoltageV) |
virtual double | GetRemainingEnergy (void) |
virtual double | GetEnergyFraction (void) |
virtual void | DecreaseRemainingEnergy (double energyJ) |
virtual void | IncreaseRemainingEnergy (double energyJ) |
virtual void | UpdateEnergySource (void) |
void | SetEnergyUpdateInterval (Time interval) |
Time | GetEnergyUpdateInterval (void) const |
![]() | |
void | SetNode (Ptr< Node > node) |
Sets pointer to node containing this EnergySource. | |
Ptr< Node > | GetNode (void) const |
void | AppendDeviceEnergyModel (Ptr< DeviceEnergyModel > deviceEnergyModelPtr) |
DeviceEnergyModelContainer | FindDeviceEnergyModels (TypeId tid) |
DeviceEnergyModelContainer | FindDeviceEnergyModels (std::string name) |
void | StartDeviceModels (void) |
void | DisposeDeviceModels (void) |
![]() | |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Dispose (void) |
void | AggregateObject (Ptr< Object > other) |
AggregateIterator | GetAggregateIterator (void) const |
void | Start (void) |
![]() | |
SimpleRefCount (const SimpleRefCount &o) | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
uint32_t | GetReferenceCount (void) const |
![]() | |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::LiIonEnergySource. |
Additional Inherited Members | |
![]() | |
double | CalculateTotalCurrent (void) |
void | NotifyEnergyDrained (void) |
void | BreakDeviceEnergyModelRefCycle (void) |
![]() | |
virtual void | NotifyNewAggregate (void) |
Object (const Object &o) |
Model a generic Lithium Ion Battery basing on [1][2].
The model can be fitted to any type of Li-Ion Battery, simply changing the model parameters. The default values are fitted for the Panasonic CGR18650DA Li-Ion Battery [3].
The energy is drained as defined from the EnergySource interface but, this class consider the non-linear behaviour of Li-Ion cell. Each time energy is drained from the cell, the class evaluates the discharge curve to get the actual cell's voltage, accordingly to State of Charge (SOC) and current's drain.
If the actual voltage of the cell goes below the minimum threshold voltage, the cell is considered depleted and the energy drained event fired up.
The model requires several parameters to approximates the discharge curves:
For a complete reference of the energy source model and model's fitting please refer to UAN Framework page and Li-Ion model fitting page.
References: [1] C. M. Shepherd, "Design of Primary and Secondary Cells - Part 3. Battery discharge equation," U.S. Naval Research Laboratory, 1963 [2] Tremblay, O.; Dessaint, L.-A.; Dekkiche, A.-I., "A Generic Battery Model for the Dynamic Simulation of Hybrid Electric Vehicles," Ecole de Technologie Superieure, Universite du Quebec, 2007 [3] http://www.panasonic.com/industrial/includes/pdf/Panasonic_LiIon_CGR18650DA.pdf
|
virtual |
energyJ | Amount of energy (in Joules) to decrease from energy source. |
Implements DecreaseRemainingEnergy.
References NS_ASSERT, and NS_LOG_FUNCTION.
|
virtual |
Implements GetEnergyFraction.
Implements ns3::EnergySource.
References NS_LOG_FUNCTION, and UpdateEnergySource().
Time ns3::LiIonEnergySource::GetEnergyUpdateInterval | ( | void | ) | const |
References NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
virtual |
Implements GetInitialEnergy.
Implements ns3::EnergySource.
References NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
virtual |
Implements GetRemainingEnergy.
Implements ns3::EnergySource.
References NS_LOG_FUNCTION, and UpdateEnergySource().
|
virtual |
Implements GetSupplyVoltage.
Implements ns3::EnergySource.
References NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
static |
This method returns the TypeId associated to ns3::LiIonEnergySource.
Attributes defined for this type:
TraceSources defined for this type:
Reimplemented from ns3::EnergySource.
References GetEnergyUpdateInterval(), GetInitialEnergy(), GetSupplyVoltage(), ns3::MakeTraceSourceAccessor(), ns3::Seconds(), SetEnergyUpdateInterval(), SetInitialEnergy(), SetInitialSupplyVoltage(), and ns3::TypeId::SetParent().
|
virtual |
energyJ | Amount of energy (in Joules) to increase from energy source. |
Implements IncreaseRemainingEnergy.
References NS_ASSERT, and NS_LOG_FUNCTION.
void ns3::LiIonEnergySource::SetEnergyUpdateInterval | ( | Time | interval | ) |
interval | Energy update interval. |
This function sets the interval between each energy update.
References NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::LiIonEnergySource::SetInitialEnergy | ( | double | initialEnergyJ | ) |
initialEnergyJ | Initial energy, in Joules |
Implements SetInitialEnergy. Note that initial energy is assumed to be set before simulation starts and is set only once per simulation.
References NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::LiIonEnergySource::SetInitialSupplyVoltage | ( | double | supplyVoltageV | ) |
supplyVoltageV | Initial Supply voltage at the energy source, in Volts. |
Sets the initial supply voltage of the energy source. To be called only once.
Referenced by GetTypeId().
|
virtual |
Implements UpdateEnergySource.
Implements ns3::EnergySource.
References ns3::EventId::Cancel(), ns3::EnergySource::GetNode(), ns3::Simulator::IsFinished(), ns3::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by GetEnergyFraction(), and GetRemainingEnergy().