diff --git a/examples/notebooks/Getting Started/plotting_a_dataset.ipynb b/examples/notebooks/Getting Started/plotting_a_dataset.ipynb index 633388374..56947a286 100644 --- a/examples/notebooks/Getting Started/plotting_a_dataset.ipynb +++ b/examples/notebooks/Getting Started/plotting_a_dataset.ipynb @@ -1,5 +1,14 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Setting up the Environment\n", + "\n", + "Before we begin, we need to ensure that we have all the necessary tools. We will install PyBOP from its development branch and upgrade some dependencies:" + ] + }, { "cell_type": "code", "execution_count": 7, @@ -19,6 +28,13 @@ "%pip install git+https://github.com/pybop-team/PyBOP.git@develop -q" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, we import the added packages plus any additional dependencies," + ] + }, { "cell_type": "code", "execution_count": 8, @@ -31,6 +47,14 @@ "import pybop\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Optimising the Parameters\n", + "First, we define the model to be used for the parameter optimisation," + ] + }, { "cell_type": "code", "execution_count": 9, @@ -42,14 +66,38 @@ "parameter_set = pybamm.get_size_distribution_parameters(parameter_set)\n", "synth_model = pybop.lithium_ion.DFN(\n", " parameter_set=parameter_set, options={\"particle size\": \"distribution\"}\n", - ")\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Simulating Forward Model\n", "\n", + "We can then simulate the model using the `predict` method, with a default constant current to generate voltage data." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "n_points = 650\n", "t_eval = np.linspace(0, 1600 + 1000, n_points)\n", "current = np.concatenate(\n", " [np.ones(400) * parameter_set[\"Nominal cell capacity [A.h]\"], np.zeros(250)]\n", ")\n", - "init_soc = 0.5\n", + "init_soc = 0.5" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "dataset = pybop.Dataset(\n", " {\n", " \"Time [s]\": t_eval,\n", @@ -57,7 +105,15 @@ " }\n", ")\n", "synth_model.build(dataset, init_soc=init_soc)\n", - "synth_model.signal = [\"Voltage [V]\"]\n" + "synth_model.signal = [\"Voltage [V]\"]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Plotting the Dataset\n", + "The `pybop.plot_dataset` function is used to visualize the dataset, showing the voltage over time." ] }, {