From 3d9390e581fa0bb624b3fe440e49a402d4a25f25 Mon Sep 17 00:00:00 2001 From: Ferran Brosa Planella Date: Mon, 29 Jun 2020 19:49:44 +0200 Subject: [PATCH] #1079 changed to DFN model so plot changes with time --- .../Tutorial 3 - Basic plotting.ipynb | 235 ++++++++---------- 1 file changed, 104 insertions(+), 131 deletions(-) diff --git a/examples/notebooks/Getting Started/Tutorial 3 - Basic plotting.ipynb b/examples/notebooks/Getting Started/Tutorial 3 - Basic plotting.ipynb index 1efc257827..921c8ccc36 100644 --- a/examples/notebooks/Getting Started/Tutorial 3 - Basic plotting.ipynb +++ b/examples/notebooks/Getting Started/Tutorial 3 - Basic plotting.ipynb @@ -29,7 +29,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 1, @@ -40,7 +40,7 @@ "source": [ "%pip install pybamm -q # install PyBaMM if it is not installed\n", "import pybamm\n", - "model = pybamm.lithium_ion.SPMe()\n", + "model = pybamm.lithium_ion.DFN()\n", "sim = pybamm.Simulation(model)\n", "sim.solve()" ] @@ -129,22 +129,6 @@ " 'Leading-order x-averaged negative electrode porosity change',\n", " 'Leading-order x-averaged separator porosity change',\n", " 'Leading-order x-averaged positive electrode porosity change',\n", - " 'Negative electrode volume-averaged velocity',\n", - " 'Positive electrode volume-averaged velocity',\n", - " 'Negative electrode volume-averaged velocity [m.s-1]',\n", - " 'Positive electrode volume-averaged velocity [m.s-1]',\n", - " 'Negative electrode volume-averaged acceleration',\n", - " 'Positive electrode volume-averaged acceleration',\n", - " 'Negative electrode volume-averaged acceleration [m.s-1]',\n", - " 'Positive electrode volume-averaged acceleration [m.s-1]',\n", - " 'X-averaged negative electrode volume-averaged acceleration',\n", - " 'X-averaged positive electrode volume-averaged acceleration',\n", - " 'X-averaged negative electrode volume-averaged acceleration [m.s-1]',\n", - " 'X-averaged positive electrode volume-averaged acceleration [m.s-1]',\n", - " 'Negative electrode pressure',\n", - " 'Positive electrode pressure',\n", - " 'X-averaged negative electrode pressure',\n", - " 'X-averaged positive electrode pressure',\n", " 'Separator pressure',\n", " 'X-averaged separator pressure',\n", " 'Negative electrode transverse volume-averaged velocity',\n", @@ -175,6 +159,22 @@ " 'X-averaged positive electrode transverse volume-averaged acceleration [m.s-2]',\n", " 'Transverse volume-averaged acceleration',\n", " 'Transverse volume-averaged acceleration [m.s-2]',\n", + " 'Negative electrode volume-averaged velocity',\n", + " 'Positive electrode volume-averaged velocity',\n", + " 'Negative electrode volume-averaged velocity [m.s-1]',\n", + " 'Positive electrode volume-averaged velocity [m.s-1]',\n", + " 'Negative electrode volume-averaged acceleration',\n", + " 'Positive electrode volume-averaged acceleration',\n", + " 'Negative electrode volume-averaged acceleration [m.s-1]',\n", + " 'Positive electrode volume-averaged acceleration [m.s-1]',\n", + " 'X-averaged negative electrode volume-averaged acceleration',\n", + " 'X-averaged positive electrode volume-averaged acceleration',\n", + " 'X-averaged negative electrode volume-averaged acceleration [m.s-1]',\n", + " 'X-averaged positive electrode volume-averaged acceleration [m.s-1]',\n", + " 'Negative electrode pressure',\n", + " 'Positive electrode pressure',\n", + " 'X-averaged negative electrode pressure',\n", + " 'X-averaged positive electrode pressure',\n", " 'Negative particle concentration',\n", " 'Negative particle concentration [mol.m-3]',\n", " 'X-averaged negative particle concentration',\n", @@ -199,6 +199,24 @@ " 'Positive electrode volume-averaged concentration',\n", " 'Positive electrode volume-averaged concentration [mol.m-3]',\n", " 'Positive electrode average extent of lithiation',\n", + " 'Negative electrode potential',\n", + " 'Negative electrode potential [V]',\n", + " 'X-averaged negative electrode potential',\n", + " 'X-averaged negative electrode potential [V]',\n", + " 'Negative electrode ohmic losses',\n", + " 'Negative electrode ohmic losses [V]',\n", + " 'X-averaged negative electrode ohmic losses',\n", + " 'X-averaged negative electrode ohmic losses [V]',\n", + " 'Gradient of negative electrode potential',\n", + " 'Positive electrode potential',\n", + " 'Positive electrode potential [V]',\n", + " 'X-averaged positive electrode potential',\n", + " 'X-averaged positive electrode potential [V]',\n", + " 'Positive electrode ohmic losses',\n", + " 'Positive electrode ohmic losses [V]',\n", + " 'X-averaged positive electrode ohmic losses',\n", + " 'X-averaged positive electrode ohmic losses [V]',\n", + " 'Gradient of positive electrode potential',\n", " 'Electrolyte concentration',\n", " 'Electrolyte concentration [mol.m-3]',\n", " 'Electrolyte concentration [Molar]',\n", @@ -220,6 +238,28 @@ " 'X-averaged separator electrolyte concentration [mol.m-3]',\n", " 'X-averaged positive electrolyte concentration',\n", " 'X-averaged positive electrolyte concentration [mol.m-3]',\n", + " 'Negative electrolyte potential',\n", + " 'Negative electrolyte potential [V]',\n", + " 'Separator electrolyte potential',\n", + " 'Separator electrolyte potential [V]',\n", + " 'Positive electrolyte potential',\n", + " 'Positive electrolyte potential [V]',\n", + " 'Electrolyte potential',\n", + " 'Electrolyte potential [V]',\n", + " 'X-averaged electrolyte potential',\n", + " 'X-averaged electrolyte potential [V]',\n", + " 'X-averaged negative electrolyte potential',\n", + " 'X-averaged negative electrolyte potential [V]',\n", + " 'X-averaged separator electrolyte potential',\n", + " 'X-averaged separator electrolyte potential [V]',\n", + " 'X-averaged positive electrolyte potential',\n", + " 'X-averaged positive electrolyte potential [V]',\n", + " 'X-averaged electrolyte overpotential',\n", + " 'X-averaged electrolyte overpotential [V]',\n", + " 'Gradient of negative electrolyte potential',\n", + " 'Gradient of separator electrolyte potential',\n", + " 'Gradient of positive electrolyte potential',\n", + " 'Gradient of electrolyte potential',\n", " 'Negative current collector temperature',\n", " 'Negative current collector temperature [K]',\n", " 'X-averaged negative electrode temperature',\n", @@ -315,23 +355,11 @@ " 'X-averaged positive electrolyte tortuosity',\n", " 'Separator tortuosity',\n", " 'X-averaged separator tortuosity',\n", - " 'Leading-order electrolyte tortuosity',\n", - " 'Leading-order negative electrolyte tortuosity',\n", - " 'Leading-order positive electrolyte tortuosity',\n", - " 'Leading-order x-averaged negative electrolyte tortuosity',\n", - " 'Leading-order x-averaged positive electrolyte tortuosity',\n", - " 'Leading-order separator tortuosity',\n", - " 'Leading-order x-averaged separator tortuosity',\n", " 'Electrode tortuosity',\n", " 'Negative electrode tortuosity',\n", " 'Positive electrode tortuosity',\n", " 'X-averaged negative electrode tortuosity',\n", " 'X-averaged positive electrode tortuosity',\n", - " 'Leading-order electrode tortuosity',\n", - " 'Leading-order negative electrode tortuosity',\n", - " 'Leading-order positive electrode tortuosity',\n", - " 'Leading-order x-averaged negative electrode tortuosity',\n", - " 'Leading-order x-averaged positive electrode tortuosity',\n", " 'Separator volume-averaged velocity',\n", " 'Separator volume-averaged velocity [m.s-1]',\n", " 'Separator volume-averaged acceleration',\n", @@ -345,10 +373,29 @@ " 'Volume-averaged acceleration [m.s-1]',\n", " 'X-averaged volume-averaged acceleration [m.s-1]',\n", " 'Pressure',\n", + " 'Negative electrode surface potential difference',\n", + " 'X-averaged negative electrode surface potential difference',\n", + " 'Negative electrode surface potential difference [V]',\n", + " 'X-averaged negative electrode surface potential difference [V]',\n", + " 'Positive electrode surface potential difference',\n", + " 'X-averaged positive electrode surface potential difference',\n", + " 'Positive electrode surface potential difference [V]',\n", + " 'X-averaged positive electrode surface potential difference [V]',\n", " 'Negative particle flux',\n", " 'X-averaged negative particle flux',\n", + " 'Negative particle distribution in x',\n", " 'Positive particle flux',\n", " 'X-averaged positive particle flux',\n", + " 'Positive particle distribution in x',\n", + " 'Negative electrode effective conductivity',\n", + " 'Negative electrode current density',\n", + " 'Negative electrode current density [A.m-2]',\n", + " 'Positive electrode effective conductivity',\n", + " 'Positive electrode current density',\n", + " 'Positive electrode current density [A.m-2]',\n", + " 'Electrode current density',\n", + " 'Electrolyte current density',\n", + " 'Electrolyte current density [A.m-2]',\n", " 'Ohmic heating',\n", " 'Ohmic heating [W.m-3]',\n", " 'Irreversible electrochemical heating',\n", @@ -369,6 +416,12 @@ " 'Sei interfacial current density',\n", " 'Sei interfacial current density [A.m-2]',\n", " 'Sei interfacial current density per volume [A.m-3]',\n", + " 'Negative electrode interfacial current density',\n", + " 'X-averaged negative electrode interfacial current density',\n", + " 'Negative electrode interfacial current density [A.m-2]',\n", + " 'X-averaged negative electrode interfacial current density [A.m-2]',\n", + " 'Negative electrode interfacial current density per volume [A.m-3]',\n", + " 'X-averaged negative electrode interfacial current density per volume [A.m-3]',\n", " 'X-averaged negative electrode total interfacial current density',\n", " 'X-averaged negative electrode total interfacial current density [A.m-2]',\n", " 'X-averaged negative electrode total interfacial current density per volume [A.m-3]',\n", @@ -382,20 +435,22 @@ " 'X-averaged negative electrode reaction overpotential',\n", " 'Negative electrode reaction overpotential [V]',\n", " 'X-averaged negative electrode reaction overpotential [V]',\n", - " 'Negative electrode surface potential difference',\n", - " 'X-averaged negative electrode surface potential difference',\n", - " 'Negative electrode surface potential difference [V]',\n", - " 'X-averaged negative electrode surface potential difference [V]',\n", - " 'Negative electrode sei film overpotential',\n", - " 'X-averaged negative electrode sei film overpotential',\n", - " 'Negative electrode sei film overpotential [V]',\n", - " 'X-averaged negative electrode sei film overpotential [V]',\n", " 'Negative electrode open circuit potential',\n", " 'Negative electrode open circuit potential [V]',\n", " 'X-averaged negative electrode open circuit potential',\n", " 'X-averaged negative electrode open circuit potential [V]',\n", " 'Negative electrode entropic change',\n", " 'X-averaged negative electrode entropic change',\n", + " 'Negative electrode sei film overpotential',\n", + " 'X-averaged negative electrode sei film overpotential',\n", + " 'Negative electrode sei film overpotential [V]',\n", + " 'X-averaged negative electrode sei film overpotential [V]',\n", + " 'Positive electrode interfacial current density',\n", + " 'X-averaged positive electrode interfacial current density',\n", + " 'Positive electrode interfacial current density [A.m-2]',\n", + " 'X-averaged positive electrode interfacial current density [A.m-2]',\n", + " 'Positive electrode interfacial current density per volume [A.m-3]',\n", + " 'X-averaged positive electrode interfacial current density per volume [A.m-3]',\n", " 'X-averaged positive electrode total interfacial current density',\n", " 'X-averaged positive electrode total interfacial current density [A.m-2]',\n", " 'X-averaged positive electrode total interfacial current density per volume [A.m-3]',\n", @@ -409,32 +464,16 @@ " 'X-averaged positive electrode reaction overpotential',\n", " 'Positive electrode reaction overpotential [V]',\n", " 'X-averaged positive electrode reaction overpotential [V]',\n", - " 'Positive electrode surface potential difference',\n", - " 'X-averaged positive electrode surface potential difference',\n", - " 'Positive electrode surface potential difference [V]',\n", - " 'X-averaged positive electrode surface potential difference [V]',\n", - " 'Positive electrode sei film overpotential',\n", - " 'X-averaged positive electrode sei film overpotential',\n", - " 'Positive electrode sei film overpotential [V]',\n", - " 'X-averaged positive electrode sei film overpotential [V]',\n", " 'Positive electrode open circuit potential',\n", " 'Positive electrode open circuit potential [V]',\n", " 'X-averaged positive electrode open circuit potential',\n", " 'X-averaged positive electrode open circuit potential [V]',\n", " 'Positive electrode entropic change',\n", " 'X-averaged positive electrode entropic change',\n", - " 'Negative electrode interfacial current density',\n", - " 'X-averaged negative electrode interfacial current density',\n", - " 'Negative electrode interfacial current density [A.m-2]',\n", - " 'X-averaged negative electrode interfacial current density [A.m-2]',\n", - " 'Negative electrode interfacial current density per volume [A.m-3]',\n", - " 'X-averaged negative electrode interfacial current density per volume [A.m-3]',\n", - " 'Positive electrode interfacial current density',\n", - " 'X-averaged positive electrode interfacial current density',\n", - " 'Positive electrode interfacial current density [A.m-2]',\n", - " 'X-averaged positive electrode interfacial current density [A.m-2]',\n", - " 'Positive electrode interfacial current density per volume [A.m-3]',\n", - " 'X-averaged positive electrode interfacial current density per volume [A.m-3]',\n", + " 'Positive electrode sei film overpotential',\n", + " 'X-averaged positive electrode sei film overpotential',\n", + " 'Positive electrode sei film overpotential [V]',\n", + " 'X-averaged positive electrode sei film overpotential [V]',\n", " 'Interfacial current density',\n", " 'Interfacial current density [A.m-2]',\n", " 'Interfacial current density per volume [A.m-3]',\n", @@ -487,69 +526,14 @@ " 'Oxygen exchange current density',\n", " 'Oxygen exchange current density [A.m-2]',\n", " 'Oxygen exchange current density per volume [A.m-3]',\n", - " 'Negative electrode potential',\n", - " 'Negative electrode potential [V]',\n", - " 'X-averaged negative electrode potential',\n", - " 'X-averaged negative electrode potential [V]',\n", - " 'Negative electrode ohmic losses',\n", - " 'Negative electrode ohmic losses [V]',\n", - " 'X-averaged negative electrode ohmic losses',\n", - " 'X-averaged negative electrode ohmic losses [V]',\n", - " 'Gradient of negative electrode potential',\n", - " 'Negative electrode current density',\n", - " 'Negative electrode current density [A.m-2]',\n", - " 'Negative electrolyte potential',\n", - " 'Negative electrolyte potential [V]',\n", - " 'Separator electrolyte potential',\n", - " 'Separator electrolyte potential [V]',\n", - " 'Positive electrolyte potential',\n", - " 'Positive electrolyte potential [V]',\n", - " 'Electrolyte potential',\n", - " 'Electrolyte potential [V]',\n", - " 'X-averaged electrolyte potential',\n", - " 'X-averaged electrolyte potential [V]',\n", - " 'X-averaged negative electrolyte potential',\n", - " 'X-averaged negative electrolyte potential [V]',\n", - " 'X-averaged separator electrolyte potential',\n", - " 'X-averaged separator electrolyte potential [V]',\n", - " 'X-averaged positive electrolyte potential',\n", - " 'X-averaged positive electrolyte potential [V]',\n", - " 'X-averaged electrolyte overpotential',\n", - " 'X-averaged electrolyte overpotential [V]',\n", - " 'Gradient of negative electrolyte potential',\n", - " 'Gradient of separator electrolyte potential',\n", - " 'Gradient of positive electrolyte potential',\n", - " 'Gradient of electrolyte potential',\n", - " 'Electrolyte current density',\n", - " 'Electrolyte current density [A.m-2]',\n", - " 'Negative electrolyte current density',\n", - " 'Negative electrolyte current density [A.m-2]',\n", - " 'Positive electrolyte current density',\n", - " 'Positive electrolyte current density [A.m-2]',\n", - " 'X-averaged concentration overpotential',\n", - " 'X-averaged electrolyte ohmic losses',\n", - " 'X-averaged concentration overpotential [V]',\n", - " 'X-averaged electrolyte ohmic losses [V]',\n", - " 'Electrolyte flux',\n", - " 'Electrolyte flux [mol.m-2.s-1]',\n", - " 'Positive electrode potential',\n", - " 'Positive electrode potential [V]',\n", - " 'X-averaged positive electrode potential',\n", - " 'X-averaged positive electrode potential [V]',\n", - " 'Positive electrode ohmic losses',\n", - " 'Positive electrode ohmic losses [V]',\n", - " 'X-averaged positive electrode ohmic losses',\n", - " 'X-averaged positive electrode ohmic losses [V]',\n", - " 'Gradient of positive electrode potential',\n", - " 'Positive electrode current density',\n", - " 'Positive electrode current density [A.m-2]',\n", - " 'Electrode current density',\n", " 'Positive current collector potential',\n", " 'Positive current collector potential [V]',\n", " 'Local voltage',\n", " 'Local voltage [V]',\n", " 'Terminal voltage',\n", " 'Terminal voltage [V]',\n", + " 'Electrolyte flux',\n", + " 'Electrolyte flux [mol.m-2.s-1]',\n", " 'X-averaged open circuit voltage',\n", " 'Measured open circuit voltage',\n", " 'X-averaged open circuit voltage [V]',\n", @@ -609,24 +593,15 @@ "Gradient of negative electrolyte potential\n", "Gradient of positive electrolyte potential\n", "Gradient of separator electrolyte potential\n", - "Leading-order electrolyte tortuosity\n", - "Leading-order negative electrolyte tortuosity\n", - "Leading-order positive electrolyte tortuosity\n", - "Leading-order x-averaged negative electrolyte tortuosity\n", - "Leading-order x-averaged positive electrolyte tortuosity\n", "Negative electrolyte concentration\n", "Negative electrolyte concentration [Molar]\n", "Negative electrolyte concentration [mol.m-3]\n", - "Negative electrolyte current density\n", - "Negative electrolyte current density [A.m-2]\n", "Negative electrolyte potential\n", "Negative electrolyte potential [V]\n", "Negative electrolyte tortuosity\n", "Positive electrolyte concentration\n", "Positive electrolyte concentration [Molar]\n", "Positive electrolyte concentration [mol.m-3]\n", - "Positive electrolyte current density\n", - "Positive electrolyte current density [A.m-2]\n", "Positive electrolyte potential\n", "Positive electrolyte potential [V]\n", "Positive electrolyte tortuosity\n", @@ -644,8 +619,6 @@ "X-averaged electrolyte concentration\n", "X-averaged electrolyte concentration [Molar]\n", "X-averaged electrolyte concentration [mol.m-3]\n", - "X-averaged electrolyte ohmic losses\n", - "X-averaged electrolyte ohmic losses [V]\n", "X-averaged electrolyte overpotential\n", "X-averaged electrolyte overpotential [V]\n", "X-averaged electrolyte potential\n", @@ -693,7 +666,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "f968f23d501444309af304745e6a5ed8", + "model_id": "05bc29521fce46919914ff7c29ad0336", "version_major": 2, "version_minor": 0 }, @@ -725,7 +698,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "ad05206a978e4eb79a1d00dfbe280550", + "model_id": "afd75a47189c4a4bb6eeb25fa1a4a32d", "version_major": 2, "version_minor": 0 }, @@ -757,7 +730,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "c8e3f3f55aff4c7db16bddacdfa9b3b7", + "model_id": "8a9bad8809ca434e9b8a9912a9280873", "version_major": 2, "version_minor": 0 }, @@ -795,7 +768,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "edfc3546907a47228300338fa25ea26f", + "model_id": "82ca5698bf78421e86adcb0bf7c78dd6", "version_major": 2, "version_minor": 0 }, @@ -843,7 +816,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "c649304824a3445183e4048604ee667e", + "model_id": "6a18e145d36b44abbfe2962af6301630", "version_major": 2, "version_minor": 0 },