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
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
li-ion-energy-source.h
Go to the documentation of this file.
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
DoStart
(
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 */
src
energy
model
li-ion-energy-source.h
Generated on Fri Dec 21 2012 19:00:35 for ns-3 by
1.8.1.2