Skip to content

Commit 46ab930

Browse files
committed
feat: add simplified battery model
1 parent 7d851cb commit 46ab930

File tree

1 file changed

+55
-2
lines changed

1 file changed

+55
-2
lines changed

examples/03_Existing Models.ipynb

+55-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
" * [BatteryElectroChemEOD](#BatteryElectroChemEOD)\n",
2929
" * [BatteryElectroChemEOL](#BatteryElectroChemEOL)\n",
3030
" * [Combined BatteryElectroChem (BatteryElectroChemEODEOL)](#Combined-BatteryElectroChem-(BatteryElectroChemEODEOL))\n",
31+
" * [Simplified Battery](#Simplified-Battery)\n",
3132
"* [Centrifugal Pump Model](#Centrifugal-Pump-Model)\n",
3233
"* [Electric Powertrain Models](#Electric-Powertrain-Models)\n",
3334
"* [Pneumatic Valve Model](#Pneumatic-Valve-Model)\n",
@@ -45,7 +46,9 @@
4546
"cell_type": "markdown",
4647
"metadata": {},
4748
"source": [
48-
"In the following battery models, the default model parameters included are for Li-ion batteries, specifically 18650-type cells. Experimental discharge curves for these cells can be downloaded from the Prognostics Center of Excellence [Data Repository](https://ti.arc.nasa.gov/tech/dash/groups/pcoe/prognostic-data-repository)."
49+
"We will start by introducing the battery models: `BatteryCircuit`, `BatteryElectroChemEOD`, `BatteryElectroChemEOL`, combined `BatteryElectroChem` (`BatteryElectroChemEODEOL`), and `SimplifiedBattery`.\n",
50+
"\n",
51+
"In the following battery models, with the exception of `SimplifiedBattery`, the default model parameters included are for Li-ion batteries, specifically 18650-type cells. Experimental discharge curves for these cells can be downloaded from the Prognostics Center of Excellence [Data Repository](https://ti.arc.nasa.gov/tech/dash/groups/pcoe/prognostic-data-repository)."
4952
]
5053
},
5154
{
@@ -452,7 +455,6 @@
452455
" 'save_freq': 1000,\n",
453456
" 'dt': 2,\n",
454457
" 'events': 'InsufficientCapacity',\n",
455-
" 'print': True\n",
456458
"}\n",
457459
"\n",
458460
"def future_loading(t, x=None):\n",
@@ -535,6 +537,57 @@
535537
"fig = simulated_results.event_states.plot(xlabel='time (s)', ylabel='event states', labels={'EOD', 'InsufficientCapacity'})"
536538
]
537539
},
540+
{
541+
"cell_type": "markdown",
542+
"metadata": {},
543+
"source": [
544+
"### Simplified Battery"
545+
]
546+
},
547+
{
548+
"cell_type": "markdown",
549+
"metadata": {},
550+
"source": [
551+
"`SimplifiedBattery` is a model from [[Sierra 2019]](https://www.sciencedirect.com/science/article/abs/pii/S0951832018301406). It was initially introduced in the __[2024 PHM Tutorial](2024PHMTutorial.ipynb)__. Unlike the previous models, the default parameters are for a Tattu battery. Let's start by importing the model, initializing an instance, and examining it."
552+
]
553+
},
554+
{
555+
"cell_type": "code",
556+
"execution_count": null,
557+
"metadata": {},
558+
"outputs": [],
559+
"source": [
560+
"from progpy.models import SimplifiedBattery\n",
561+
"\n",
562+
"batt = SimplifiedBattery()\n",
563+
"\n",
564+
"print('inputs:', batt.inputs)\n",
565+
"print('outputs:', batt.outputs)\n",
566+
"print('event(s): ', batt.events)\n",
567+
"print('states:', batt.states)"
568+
]
569+
},
570+
{
571+
"cell_type": "markdown",
572+
"metadata": {},
573+
"source": [
574+
"We will now define future loading based on a piecewise function and simulate to a set time."
575+
]
576+
},
577+
{
578+
"cell_type": "code",
579+
"execution_count": null,
580+
"metadata": {},
581+
"outputs": [],
582+
"source": [
583+
"future_loading = Piecewise(\n",
584+
" dict,\n",
585+
" [600, 900, 1800, 3000, float('inf')],\n",
586+
" {'P': [25, 12, 50, 25, 33]})\n",
587+
"\n",
588+
"result = batt.simulate_to(200, future_loading, {'v': 4.183})"
589+
]
590+
},
538591
{
539592
"cell_type": "markdown",
540593
"metadata": {},

0 commit comments

Comments
 (0)