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 applyyourCprogrammingknowledgeandskillsgained fromthe unit lectures andlaboratoryclasses to interpretand analyseareal-world electricalengineering dataset.
INTRODUCTION
THE DATASET
Theglobalscienceandengineeringsafetycompany, UnderwritersLaboratories, has published a dataset [1] fromtheir investigationsinto repeatedbattery cycling andthe effectsithason cell currentcarryingcapacityandtotalenergycapacity. Thebattery under investigationinthisdataset isof alithiumnickelcobaltaluminium chemistry and housedina cylindricalcell18650 formfactor (Figure 1) witha 3400mAh current capacity.
LITHIUM BATTERY CELL UNDER INVESTIGATION
• NominalCapacity=3400mAh
• Graphite/NCA
• 18650Cell
Thistypeofcell isidenticaltothose found inaTeslaModelSbattery pack.
Figure 1:18650Lithium-IonNCA BatteryCell |
Figure 2:18650cellsbeingusedinaTesla ModelS100kWh batterypack [2] |
The measurementscontainedwithin thisdataset involvedcycling this 18650 battery cell
from0-100%discharge ataconstantcurrent of 0.5 cell capacity = (3.4 Ah*0.5= 1.6 A), and ata constanttemperatureof23°C while recording thefollowing parameters:
• Minandmaxcurrent (A)
• Minandmax voltage (VDC)
• Chargeanddischargecapacity(Ah)
• Chargeanddischargeenergy(Wh)
Thelarger dataset [1] contains 20other testsmeasuringatdifferent currents, temperatures, andratesofdischarge.Testslike these areusefulforassessingthe expectedlifetime ofbatteries whensubjectedtodifferentenvironments,aswellas for assessingtheir safetyprofiles.
Inthisfolder youwillfindareduced versionoftheoriginaldataset (dataset.txt) showingonlytheresultsfromthe followingcolumns:
Column1:Testnumber |
Column2:BatteryCharge Capacity(units:Ah) |
Column3:BatteryEnergy Capacity(units:Wh) |
The reduced dataset is formattedinCSVformat(commaseparatedvariable)and contains atotalof 319 results.
TASKS
Yourtaskisto writeaCprogram toperform some preliminary dataanalysison 100 selected results fromthisreduceddataset and then output your findings ontothe terminal ina pre-specified format(seebelow).
Inthisfolderyouwillfind aCprogramthatis designedtohelpyougetstartedreadingin valuesfromtheCSVfile.Thisprogram usesthefscanffunctiontoreadin3values which itthenstoresin simplearrays.
Yourtask istoextendthis code sothatit utilises3 pre-specified datastructures (see below) in place of the arrays forstoringthe testresults.Youthenarerequiredto write the necessaryalgorithmsforanalysing thedata(seebelow) and to constructthe printf statementsrequiredforpresentingyourfindings inapre-specifiedformat (seebelow).
Step 1: Setup data structures for storing your results
Yourprogramshould define3types of datastructures forholdingthe results:
Structure1: Name= BatteryTest
Membername |
Type |
Notes |
n |
int |
Forstoringthetest number |
ch_capacity |
float |
Forstoringthe chargecapacityresults |
ch_energy |
float |
For storingthechargeenergyresults |
Yourprogramshould initialiseanarrayof319BatteryTeststructs.
2022-05-09