ns-3
ns3::RvBatteryModel Class Reference

Rakhmatov Vrudhula non-linear battery model. More...

#include <rv-battery-model.h>

Inheritance diagram for ns3::RvBatteryModel:
Collaboration diagram for ns3::RvBatteryModel:

List of all members.

Public Member Functions

virtual double GetInitialEnergy (void) const
virtual double GetSupplyVoltage (void) const
virtual double GetRemainingEnergy (void)
virtual double GetEnergyFraction (void)
virtual void UpdateEnergySource (void)
void SetSamplingInterval (Time interval)
Time GetSamplingInterval (void) const
void SetOpenCircuitVoltage (double voltage)
 Sets open circuit voltage of battery.
double GetOpenCircuitVoltage (void) const
void SetCutoffVoltage (double voltage)
 Sets cutoff voltage of battery.
double GetCutoffVoltage (void) const
void SetAlpha (double alpha)
 Sets the alpha value for the battery model.
double GetAlpha (void) const
void SetBeta (double beta)
 Sets the beta value for the battery model.
double GetBeta (void) const
double GetBatteryLevel (void)
Time GetLifetime (void) const
void SetNumOfTerms (int num)
 Sets the number of terms of the infinite sum for estimating battery level.
int GetNumOfTerms (void) const

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::RvBatteryModel.

Detailed Description

Rakhmatov Vrudhula non-linear battery model.

This (energy source) model implements an analytical non-linear battery model. It is capable of capturing load capacity and recovery effects of batteries. Batteries are characterized by 2 parameters, alpha and beta, which can both be obtained from the discharge curve of the batteries.

The model is developed by Daler Rakhmatov & Sarma Vrudhula in: "Battery Lifetime Prediction for Energy-Aware Computing" and "An Analytical High-Level Battery Model for Use in Energy Management of Portable Electronic Systems".

The real-time algorithm is developed by Matthias Handy & Dirk Timmermann in: "Simulation of Mobile Wireless Networks with Accurate Modeling of non-linear battery effects". The real-time algorithm is modified by the authors of this code for improved accuracy and reduced computation (sampling) overhead.


Member Function Documentation

double ns3::RvBatteryModel::GetAlpha ( void  ) const
Returns:
The alpha value used by the battery model.

Referenced by GetTypeId().

Returns:
Battery level [0, 1].

References NS_LOG_FUNCTION, and UpdateEnergySource().

Referenced by GetEnergyFraction().

double ns3::RvBatteryModel::GetBeta ( void  ) const
Returns:
The beta value used by the battery model.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetCutoffVoltage ( void  ) const
Returns:
Cutoff voltage of battery.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetEnergyFraction ( void  ) [virtual]
Returns:
Energy fraction.

Implements GetEnergyFraction. For the RV battery model, energy fraction is equivalent to battery level.

Implements ns3::EnergySource.

References GetBatteryLevel().

double ns3::RvBatteryModel::GetInitialEnergy ( void  ) const [virtual]
Returns:
Initial energy stored (theoretical capacity) in the battery.

Implements GetInitialEnergy.

Implements ns3::EnergySource.

References GetSupplyVoltage().

Returns:
Lifetime of the battery.
int ns3::RvBatteryModel::GetNumOfTerms ( void  ) const
Returns:
The number of terms of the infinite sum for estimating battery level.

Referenced by GetTypeId().

Returns:
Open circuit voltage of battery.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetRemainingEnergy ( void  ) [virtual]
Returns:
Remaining energy in energy source, in Joules

Implements GetRemainingEnergy.

Implements ns3::EnergySource.

References GetSupplyVoltage(), NS_LOG_FUNCTION, and UpdateEnergySource().

Returns:
The interval between each energy update.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetSupplyVoltage ( void  ) const [virtual]
Returns:
Supply voltage at the energy source.

Implements GetSupplyVoltage.

Implements ns3::EnergySource.

Referenced by GetInitialEnergy(), and GetRemainingEnergy().

This method returns the TypeId associated to ns3::RvBatteryModel.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::EnergySource/$ns3::RvBatteryModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::RvBatteryModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::EnergySource/$ns3::RvBatteryModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::RvBatteryModel

Attributes defined for this type:

  • RvBatteryModelPeriodicEnergyUpdateInterval: RV battery model sampling interval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +1000000000.0ns
    • Flags: construct write read
  • RvBatteryModelOpenCircuitVoltage: RV battery model open circuit voltage.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 4.1
    • Flags: construct write read
  • RvBatteryModelCutoffVoltage: RV battery model cutoff voltage.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 3
    • Flags: construct write read
  • RvBatteryModelAlphaValue: RV battery model alpha value.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 35220
    • Flags: construct write read
  • RvBatteryModelBetaValue: RV battery model beta value.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.637
    • Flags: construct write read
  • RvBatteryModelNumOfTerms: The number of terms of the infinite sum for estimating battery level.
    • Set with class: ns3::IntegerValue
    • Underlying type: int32_t -2147483648:2147483647
    • Initial value: 10
    • Flags: construct write read

TraceSources defined for this type:

  • RvBatteryModelBatteryLevel: RV battery model battery level.
  • RvBatteryModelBatteryLifetime: RV battery model battery lifetime.

Reimplemented from ns3::EnergySource.

References GetAlpha(), GetBeta(), GetCutoffVoltage(), GetNumOfTerms(), GetOpenCircuitVoltage(), GetSamplingInterval(), ns3::MakeTraceSourceAccessor(), ns3::Seconds(), SetAlpha(), SetBeta(), SetCutoffVoltage(), SetNumOfTerms(), SetOpenCircuitVoltage(), ns3::TypeId::SetParent(), and SetSamplingInterval().

void ns3::RvBatteryModel::SetAlpha ( double  alpha)

Sets the alpha value for the battery model.

Parameters:
alphaAlpha.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::SetBeta ( double  beta)

Sets the beta value for the battery model.

Parameters:
betaBeta.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::SetCutoffVoltage ( double  voltage)

Sets cutoff voltage of battery.

Parameters:
voltageCutoff voltage.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

Sets the number of terms of the infinite sum for estimating battery level.

Parameters:
numNumber of terms.

References NS_LOG_FUNCTION.

Referenced by GetTypeId().

Sets open circuit voltage of battery.

Parameters:
voltageOpen circuit voltage.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

Parameters:
intervalEnergy update interval.

This function sets the interval between each energy update.

References NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::UpdateEnergySource ( void  ) [virtual]

Implements UpdateEnergySource. This function samples the total load (total current) from all devices to discharge the battery.

Implements ns3::EnergySource.

References ns3::EnergySource::CalculateTotalCurrent(), ns3::EventId::Cancel(), ns3::Simulator::IsFinished(), ns3::Now(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().

Referenced by GetBatteryLevel(), and GetRemainingEnergy().


The documentation for this class was generated from the following files: