Battery: Model a Chemical Electrical System

Introduction

In this example the temperature impact on battery cell lifetime is investigated.

Explore the available scenarios by evaluating each cell in order. Evaluation is done by selecting a cell and pressing Shift+Enter.

In order to get the full experience of this example, you need the following:

Wolfram SystemModeler; a free trial download is available at www.wolfram.com/system-modeler

The model that came in the same bundle as this notebook

For more information about Wolfram SystemModeler, visit www.wolfram.com/system-modeler.

Initialize

Define the model name:

mmodel="EducationExamples.ElectricalEngineering.Battery.ChargeDischarge";

Temperature Dependence

The ChargeDischarge model will discharge the battery in intervals until it reaches a state of charge of 0.1 and then re-charge the battery in intervals until it reaches a state of charge of 0.9. One battery cell is held at 25°C and the other at 50°C.

Simulate the model for one million seconds at the two different temperatures:

sim=SystemModelSimulate[mmodel,{0,100000},
<|"ParameterValues"->{"T"->QuantityMagnitude[{(Quantity[25, "°C", degrees Celsius, "DegreesCelsius"]),(Quantity[50, "°C", degrees Celsius, "DegreesCelsius"])},"DegreesCelsius"]}|>];

Get the cycles where the battery is on:

{coldCycles,lastWarmCycle}=Quiet[{Reduce[sim[[1]][{"hysteresis.y"},t][[1]]==True,t],Reduce[sim[[2]][{"hysteresis.y"},t][[1]]==True,t][[-2]]}]

Pick out the start and stop times for the cycles:

{startFirstCycle,stopFirstCycle}={Round[MinValue[{t,coldCycles[[1]]},t]],MaxValue[{t,coldCycles[[1]]},t]}

{startLastCycleCold,stopLastCycleCold}={MinValue[{t,coldCycles[[-2]]},t],MaxValue[{t,coldCycles[[-2]]},t]}

{startLastCycleWarm,stopLastCycleWarm}={MinValue[{t,lastWarmCycle},t],MaxValue[{t,lastWarmCycle},t]}

Plot the first cycle, where the battery cells perform similarly:

SystemModelPlot[sim,"All Cycles",{startFirstCycle,stopFirstCycle},PlotLabel->"First Cycle",PlotLegends->{(Quantity[25, "°C", degrees Celsius, "DegreesCelsius"]),(Quantity[50, "°C", degrees Celsius, "DegreesCelsius"])}]

Plot the last cycle, where the cold battery cell performs much better:

Show[{
SystemModelPlot[sim[[2]],"All Cycles",{startLastCycleWarm,stopLastCycleWarm},PlotLabel->"Last Cycle",PlotLegends->{(Quantity[25, "°C", degrees Celsius, "DegreesCelsius"])},PlotStyle->ColorData[97][1]],
SystemModelPlot[sim[[1]],"All Cycles",{startLastCycleCold,stopLastCycleCold},PlotLabel->"Last Cycle",PlotLegends->{(Quantity[50, "°C", degrees Celsius, "DegreesCelsius"])},PlotStyle->ColorData[97][2]]
}]

Terms and Conditions of Use

This domain example is an informational resource made freely available by Wolfram Research.

Use of This Example

• You may not use this example for any purpose that is unlawful or dangerous.
• You assume total responsibility and risk for your use of this example.
• You may not present this example with any alteration to its trade dress, trademarks, or design.

License

All content in this bundle is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. By accessing the content or using it in any way, you accept and agree to be bound by the terms of this license. If you do not agree to these Terms of Use, you may not use this content. Wolfram Research reserves the right to change, modify, add to, or remove portions of these Terms of Use at any time without notice. Please refer back to www.wolfram.com for the latest Terms of Use.

A summary of the licensing terms can be found at:
http://creativecommons.org/licenses/by-nc-sa/3.0

The full legal code can be found at: 
http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode