From 692b19dbea87f4ba48b8c5968f1a094628a90bb4 Mon Sep 17 00:00:00 2001 From: jack Date: Thu, 31 Dec 2020 16:49:47 +1100 Subject: [PATCH] modified to show use of cycles --- .../Tutorial 5 - Run experiments.ipynb | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/examples/notebooks/Getting Started/Tutorial 5 - Run experiments.ipynb b/examples/notebooks/Getting Started/Tutorial 5 - Run experiments.ipynb index d14cac014d..659e79d908 100644 --- a/examples/notebooks/Getting Started/Tutorial 5 - Run experiments.ipynb +++ b/examples/notebooks/Getting Started/Tutorial 5 - Run experiments.ipynb @@ -47,11 +47,11 @@ "source": [ "experiment = pybamm.Experiment(\n", " [\n", - " \"Discharge at C/10 for 10 hours or until 3.3 V\",\n", + " (\"Discharge at C/10 for 10 hours or until 3.3 V\",\n", " \"Rest for 1 hour\",\n", " \"Charge at 1 A until 4.1 V\",\n", " \"Hold at 4.1 V until 50 mA\",\n", - " \"Rest for 1 hour\",\n", + " \"Rest for 1 hour\"),\n", " ] * 3\n", ")" ] @@ -60,7 +60,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "In this case, the experiment consists of a cycle of constant current C/10 discahrge, a one hour rest, a constant current (1 A) constant voltage (4.1 V) and another one hour rest, all of it repeated three times (notice the `* 3`).\n", + "A cycle is defined by a tuple of operating instructions. In this case, the experiment consists of a cycle of constant current C/10 discharge, a one hour rest, a constant current (1 A) constant voltage (4.1 V) and another one hour rest, all of it repeated three times (notice the * 3).\n", "\n", "Then we can choose our model" ] @@ -146,33 +146,30 @@ "\n", "Optionally, each instruction can contain at the end the expression \"(x minute period)\" in which the period at which to record the simulation outputs during that instruction. To change the period for the whole experiment we can pass it as a keyword argument in the experiment.\n", "\n", - "Additionally, we can use the operators `+` and `*` to combine and repeat lists:" + "Additionally, we can use the operators `+` and `*` on lists in order to combine and repeat cycles:" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { + "output_type": "execute_result", "data": { "text/plain": [ - "['Discharge at 1C for 0.5 hours',\n", - " 'Discharge at C/20 for 0.5 hours',\n", - " 'Discharge at 1C for 0.5 hours',\n", - " 'Discharge at C/20 for 0.5 hours',\n", - " 'Discharge at 1C for 0.5 hours',\n", - " 'Discharge at C/20 for 0.5 hours',\n", - " 'Charge at 0.5 C for 45 minutes']" + "[('Discharge at 1C for 0.5 hours', 'Discharge at C/20 for 0.5 hours'),\n", + " ('Discharge at 1C for 0.5 hours', 'Discharge at C/20 for 0.5 hours'),\n", + " ('Discharge at 1C for 0.5 hours', 'Discharge at C/20 for 0.5 hours'),\n", + " ('Charge at 0.5 C for 45 minutes',)]" ] }, - "execution_count": 6, "metadata": {}, - "output_type": "execute_result" + "execution_count": 4 } ], "source": [ - "[\"Discharge at 1C for 0.5 hours\", \"Discharge at C/20 for 0.5 hours\"] * 3 + [\"Charge at 0.5 C for 45 minutes\"]" + "[(\"Discharge at 1C for 0.5 hours\", \"Discharge at C/20 for 0.5 hours\")] * 3 + [(\"Charge at 0.5 C for 45 minutes\",)]" ] }, { @@ -206,9 +203,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.8" + "version": "3.8.2-final" } }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file