A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
li-ion-energy-source.h
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Andrea Sacco
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Andrea Sacco <andrea.sacco85@gmail.com>
19
*/
20
21
#ifndef LI_ION_ENERGY_SOURCE_H
22
#define LI_ION_ENERGY_SOURCE_H
23
24
#include "ns3/traced-value.h"
25
#include "ns3/energy-source.h"
26
#include "ns3/nstime.h"
27
#include "ns3/event-id.h"
28
29
namespace
ns3 {
30
72
class
LiIonEnergySource
:
public
EnergySource
73
{
74
public
:
75
static
TypeId
GetTypeId (
void
);
76
LiIonEnergySource
();
77
virtual
~
LiIonEnergySource
();
78
84
virtual
double
GetInitialEnergy
(
void
)
const
;
85
92
void
SetInitialEnergy
(
double
initialEnergyJ);
93
99
virtual
double
GetSupplyVoltage
(
void
)
const
;
100
107
void
SetInitialSupplyVoltage
(
double
supplyVoltageV);
108
114
virtual
double
GetRemainingEnergy
(
void
);
115
121
virtual
double
GetEnergyFraction
(
void
);
122
128
virtual
void
DecreaseRemainingEnergy
(
double
energyJ);
129
135
virtual
void
IncreaseRemainingEnergy
(
double
energyJ);
136
140
virtual
void
UpdateEnergySource
(
void
);
141
147
void
SetEnergyUpdateInterval
(
Time
interval);
148
152
Time
GetEnergyUpdateInterval
(
void
)
const
;
153
private
:
154
void
DoInitialize
(
void
);
155
void
DoDispose
(
void
);
156
162
void
HandleEnergyDrainedEvent
(
void
);
163
172
void
CalculateRemainingEnergy
(
void
);
173
181
double
GetVoltage
(
double
current)
const
;
182
183
private
:
184
double
m_initialEnergyJ;
// initial energy, in Joules
185
TracedValue<double>
m_remainingEnergyJ;
// remaining energy, in Joules
186
double
m_drainedCapacity;
// capacity drained from the cell, in Ah
187
double
m_supplyVoltageV;
// actual voltage of the cell
188
EventId
m_energyUpdateEvent;
// energy update event
189
Time
m_lastUpdateTime;
// last update time
190
Time
m_energyUpdateInterval;
// energy update interval
191
double
m_eFull;
// initial voltage of the cell, in Volts
192
double
m_eNom;
// nominal voltage of the cell, in Volts
193
double
m_eExp;
// cell voltage at the end of the exponential zone, in Volts
194
double
m_internalResistance;
// internal resistance of the cell, in Ohms
195
double
m_qRated;
// rated capacity of the cell, in Ah
196
double
m_qNom;
// cell capacity at the end of the nominal zone, in Ah
197
double
m_qExp;
// capacity value at the end of the exponential zone, in Ah
198
double
m_typCurrent;
// typical discharge current used to fit the curves
199
double
m_minVoltTh;
// minimum threshold voltage to consider the battery depleted
200
};
201
202
}
// namespace ns3
203
204
#endif
/* LI_ION_ENERGY_SOURCE_H */
ns3::Time
keep track of time unit.
Definition:
nstime.h:149
ns3::LiIonEnergySource::SetEnergyUpdateInterval
void SetEnergyUpdateInterval(Time interval)
Definition:
li-ion-energy-source.cc:152
ns3::LiIonEnergySource::GetEnergyFraction
virtual double GetEnergyFraction(void)
Definition:
li-ion-energy-source.cc:175
ns3::EnergySource
Energy source base class.
Definition:
energy-source.h:71
ns3::LiIonEnergySource::DoDispose
void DoDispose(void)
Definition:
li-ion-energy-source.cc:246
ns3::LiIonEnergySource::UpdateEnergySource
virtual void UpdateEnergySource(void)
Definition:
li-ion-energy-source.cc:206
ns3::TracedValue< double >
ns3::LiIonEnergySource::GetInitialEnergy
virtual double GetInitialEnergy(void) const
Definition:
li-ion-energy-source.cc:130
ns3::LiIonEnergySource::GetVoltage
double GetVoltage(double current) const
Definition:
li-ion-energy-source.cc:283
ns3::LiIonEnergySource::CalculateRemainingEnergy
void CalculateRemainingEnergy(void)
Definition:
li-ion-energy-source.cc:267
ns3::LiIonEnergySource::GetRemainingEnergy
virtual double GetRemainingEnergy(void)
Definition:
li-ion-energy-source.cc:166
ns3::LiIonEnergySource::SetInitialSupplyVoltage
void SetInitialSupplyVoltage(double supplyVoltageV)
Definition:
li-ion-energy-source.cc:137
ns3::LiIonEnergySource::HandleEnergyDrainedEvent
void HandleEnergyDrainedEvent(void)
Definition:
li-ion-energy-source.cc:256
ns3::EventId
an identifier for simulation events.
Definition:
event-id.h:46
ns3::LiIonEnergySource::GetEnergyUpdateInterval
Time GetEnergyUpdateInterval(void) const
Definition:
li-ion-energy-source.cc:159
ns3::LiIonEnergySource::GetSupplyVoltage
virtual double GetSupplyVoltage(void) const
Definition:
li-ion-energy-source.cc:145
ns3::LiIonEnergySource::DecreaseRemainingEnergy
virtual void DecreaseRemainingEnergy(double energyJ)
Definition:
li-ion-energy-source.cc:184
ns3::LiIonEnergySource::IncreaseRemainingEnergy
virtual void IncreaseRemainingEnergy(double energyJ)
Definition:
li-ion-energy-source.cc:198
ns3::LiIonEnergySource::SetInitialEnergy
void SetInitialEnergy(double initialEnergyJ)
Definition:
li-ion-energy-source.cc:120
ns3::LiIonEnergySource
Model a generic Lithium Ion Battery basing on [1][2].
Definition:
li-ion-energy-source.h:72
ns3::LiIonEnergySource::DoInitialize
void DoInitialize(void)
Definition:
li-ion-energy-source.cc:239
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:44
src
energy
model
li-ion-energy-source.h
Generated on Sun Mar 16 2014 11:25:03 for ns-3 by
1.8.6