C Programming: Coursework Assignment (2022)
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Department of Electrical and Electronic Engineering
C Programming: Coursework Assignment (2022)
OBJECTIVE
• To apply
your
C
programming
knowledge
and
skills
gained from
the unit lectures and
laboratory
classes to interpret
and analyse
a
real-world electrical
engineering dataset.
INTRODUCTION
THE DATASET
The
global
science
and
engineering
safety
company, Underwriters
Laboratories, has published a dataset [1] from
their investigations
into repeated
battery cycling and
the effects
it
has
on cell current
carrying
capacity
and
total
energy
capacity. The
battery under investigation
in
this
dataset is
of a
lithium
nickel
cobalt
aluminium chemistry and housed
in
a cylindrical
cell
18650 formfactor (Figure 1) with
a 3400
mAh current capacity.
LITHIUM BATTERY CELL UNDER INVESTIGATION
• Nominal
Capacity
=
3400
mAh
• Graphite
/
NCA
• 18650
Cell
This
type
of
cell is
identical
to
those found in
a
Tesla
Model
S
battery pack.
|
Figure 1: |
Figure 2: |
The measurements
contained
within this
dataset involved
cycling this 18650 battery cell
from
0-100%
discharge at
a
constant
current of 0.5 cell capacity = (3.4 Ah
*
0.5
= 1.6 A), and at
a constant
temperature
of
23°C while recording the
following parameters:
• Min
and
max
current (A)
• Min
and
max voltage (VDC)
• Charge
and
discharge
capacity
(Ah)
• Charge
and
discharge
energy
(Wh)
The
larger dataset [1] contains 20
other tests
measuring
at
different currents, temperatures, and
rates
of
discharge.
Tests
like these are
useful
for
assessing
the expected
lifetime of
batteries when
subjected
to
different
environments,
as
well
as for assessing
their safety
profiles.
In
this
folder you
will
find
a
reduced version
of
the
original
dataset (dataset.txt) showing
only
the
results
from
the following
columns:
|
Column |
Column |
Column |
The reduced dataset is formatted
in
CSV
format
(comma
separated
variable)
and contains a
total
of 319 results.
TASKS
Your
task
is
to write
a
C
program to
perform some preliminary data
analysis
on 100 selected results from
this
reduced
dataset and then output your findings onto
the terminal in
a pre-specified format
(see
below).
In
this
folder
you
will
find a
C
program
that
is designed
to
help
you
get
started
reading
in values
from
the
CSV
file.
This
program uses
the
fscanf
function
to
read
in
3
values which it
then
stores
in simple
arrays.
Your
task is
to
extend
this code so
that
it utilises
3 pre-specified data
structures (see below) in place of the arrays for
storing
the test
results.
You
then
are
required
to write the necessary
algorithms
for
analysing the
data
(see
below) and to construct
the printf statements
required
for
presenting
your
findings in
a
pre-specified
format (see
below).
Step 1: Setup data structures for storing your results
Your
program
should define
3
types of data
structures for
holding
the results:
Structure
1: Name
= BatteryTest
|
Member |
Type |
Notes |
|
n |
int |
For |
|
ch_capacity |
float |
For |
|
ch_energy |
float |
For storing |
Your
program
should initialise
an
array
of
319
BatteryTest
structs.
2022-05-09

