Skip to content

Commit a756620

Browse files
committed
Updated readme
1 parent e19002f commit a756620

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install PyBatte
1919
pip install pybatteryid
2020
```
2121

22-
## Required experimental datasets
22+
## Regarding the required experiments
2323

2424
There are a few experiments that the user may need to perform before using PyBatteryID, namely,
2525

26-
1. **Battery electromotive force (EMF)**: Also referred to as the open-circuit voltage (OCV). The user needs to provide (SOC, EMF) points that cover the SOC range expected in the test application. PyBatteryID performs interpolation using the given points to determine an EMF value for a certain SOC value. Note that by design, PyBatteryID DOES NOT perform extrapolation outside the given SOC range, because this can lead to poor modelling results.
26+
1. **Battery electromotive force (EMF) data**: Also referred to as the open-circuit voltage (OCV). The user needs to provide the (SOC, EMF) points that cover the SOC range expected in the test application. PyBatteryID performs interpolation using the given points to determine an EMF value for a certain SOC value. Note that by design, PyBatteryID DOES NOT perform extrapolation outside the given SOC range, because this can lead to poor modelling results.
2727

28-
2. **Informative identification experiment(s)**: The user must provide a sufficiently informative identification dataset, comprising current-voltage data (and optionally, temperature data if temperature-dependent models are desired). Please DO NOT expect a low-quality dataset, such as an HPPC test or a random drive cycle, to give you good models. In our paper [1], we have emphasised as much as possible that an informative dataset is crucial for obtaining high-quality (accurate, sparse, etc.) models, while presenting a current profile design that can lead to suitable identification datasets (see [examples/4_input_design.ipynb](/examples/4_input_design.ipynb)). Also note that this requirement holds for *any* modelling activity, and not specific to PyBatteryID or batteries, namely, it is a general principle of the **[System Identification](https://en.wikipedia.org/wiki/System_identification)** to use informative identification datasets.
28+
2. **Current--voltage data**: The user must provide a sufficiently informative identification dataset, comprising current-voltage data (and optionally, temperature data if temperature-dependent models are desired). Please DO NOT expect a low-quality dataset, such as an HPPC test or a random drive cycle, to give you good models. In our paper [1], we have emphasised as much as possible that an informative dataset is crucial for obtaining high-quality (accurate, sparse, etc.) models, while presenting a current profile design that can lead to suitable identification datasets (see [examples/4_input_design.ipynb](/examples/4_input_design.ipynb)). Also note that this requirement holds for *any* modelling activity, and not specific to PyBatteryID or batteries, namely, it is a general principle of the **[System Identification](https://en.wikipedia.org/wiki/System_identification)** to use informative identification datasets.
2929

3030
## Basic usage
3131

3232
In the following, an example usage of PyBatteryID has been demonstrated for modelling the battery overpotential using the LPV framework while assuming the battery electromotive force (EMF) to be known *a priori* via appropriate experiments, such as GITT, or low-current cycling. In effect, the battery voltage output at a given time instant can then be calculated by using the EMF value at that instant and evaluating the overpotential using the identified LPV model.
3333

34-
> It is recommended that the user follows the International System of Units (SI) while using PyBatteryID. For example, the battery capacity should be specified in Coulombs, time in seconds, current in amperes, and voltage in volts. For the temperature, both Celsius or Kelvin can be used as long as the user stays consistent and adjusts the temperature-related basis functions accordingly. Note that the temperature is in Celsius in the [examples](/examples/3_1_nmc_with_temperature_identification.ipynb) provided with the package.
34+
> It is recommended that the user follows the International System of Units (SI) while using PyBatteryID. For example, the battery capacity should be specified in Coulombs, time in seconds, current in amperes, and voltage in volts. For the temperature, both Celsius or Kelvin can be used as long as the user stays consistent and adjusts the temperature-related basis functions accordingly. Note that the temperature is in Celsius in the [example](/examples/3_1_nmc_with_temperature_identification.ipynb) provided with the package.
3535
3636
#### 1. Initialize model structure
3737

examples/3_1_nmc_with_temperature_identification.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45353,7 +45353,7 @@
4535345353
"name": "python",
4535445354
"nbconvert_exporter": "python",
4535545355
"pygments_lexer": "ipython3",
45356-
"version": "3.12.4"
45356+
"version": "3.13.5"
4535745357
}
4535845358
},
4535945359
"nbformat": 4,

pybatteryid/basisfunctions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def extract_basis_functions(basis_function_strings: list[str]) -> list[BasisFunc
4242
r"(([0-9]*[.])?[0-9]+)\]$", [0, 1, 3], Operation.LOWPASS)
4343
]
4444
#
45-
for i, function_string in enumerate(basis_function_strings):
45+
for function_string in basis_function_strings:
4646
for identifier, indices, operation in identifiers:
4747
#
4848
result = re.findall(identifier, function_string.strip())
@@ -52,7 +52,7 @@ def extract_basis_functions(basis_function_strings: list[str]) -> list[BasisFunc
5252
basis_functions.append(BasisFunction(result[indices[0]], operation, args,
5353
function_string))
5454
break
55-
if len(basis_functions) == i:
55+
else:
5656
raise ValueError(f"Could not recognize expression: {function_string}")
5757
return basis_functions
5858

pybatteryid/identification.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def identify_model(datasets: list[CurrentVoltageData] | CurrentVoltageData,
6666
# Shorthand for convenience
6767
ms = model_structure
6868
#
69-
if isinstance(datasets, dict):
70-
datasets = [ datasets ]
69+
if not isinstance(datasets, list):
70+
datasets = [datasets]
7171
regression_problems, regressor_labels = setup_regression_problems(datasets,
7272
model_structure,
7373
model_order,

0 commit comments

Comments
 (0)