A Discrete-Event Network Simulator
API
li-ion-energy-source-example.cc File Reference
#include "ns3/command-line.h"
#include "ns3/energy-source-container.h"
#include "ns3/li-ion-energy-source.h"
#include "ns3/log.h"
#include "ns3/simple-device-energy-model.h"
#include "ns3/simulator.h"
+ Include dependency graph for li-ion-energy-source-example.cc:

Go to the source code of this file.

Functions

static void PrintCellInfo (Ptr< LiIonEnergySource > es)
 In this simple example, we show how to create and drain energy from a LiIonEnergySource. More...
 

Function Documentation

◆ PrintCellInfo()

static void PrintCellInfo ( Ptr< LiIonEnergySource es)
static

In this simple example, we show how to create and drain energy from a LiIonEnergySource.

We make a series of discharge calls to the energy source class with different current drain and duration until all the energy is depleted from the cell.

Every 20 seconds it is printed out the actual cell voltage to verify that it follows the discharge curve of the datasheet [1].

At the end of the example it is verified that after the energy depletion call, the cell voltage is below the threshold voltage.

References: [1] Panasonic CGR18650DA Datasheet, http://www.panasonic.com/industrial/includes/pdf/Panasonic_LiIon_CGR18650DA.pdf

Definition at line 48 of file li-ion-energy-source-example.cc.

References ns3::Time::As(), ns3::Simulator::IsFinished(), ns3::Simulator::Now(), ns3::Time::S, ns3::Simulator::Schedule(), and ns3::Seconds().

+ Here is the call graph for this function: