{ "cells": [ { "cell_type": "markdown", "id": "3227661c7ad98a63", "metadata": {}, "source": "# Tutorial 15 - add_soc" }, { "cell_type": "markdown", "id": "55bbc37fc6a453b4", "metadata": {}, "source": "## Step 0: Setup the project and prepare the data" }, { "cell_type": "code", "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { "end_time": "2026-06-18T12:01:30.527739800Z", "start_time": "2026-06-18T12:01:30.009898800Z" } }, "source": [ "from pathlib import Path\n", "\n", "import pydpeet as eet" ], "outputs": [], "execution_count": 1 }, { "cell_type": "markdown", "id": "c44394f08aac949e", "metadata": {}, "source": "We will use \"ERROR\" as the logging style for better readability of the notebook" }, { "cell_type": "code", "id": "9edef9d707e9392f", "metadata": { "ExecuteTime": { "end_time": "2026-06-18T12:01:30.534489200Z", "start_time": "2026-06-18T12:01:30.528243Z" } }, "source": [ "eet.set_logging_style(\"ERROR\")" ], "outputs": [], "execution_count": 2 }, { "cell_type": "code", "id": "f07e60bdeabfbc23", "metadata": { "ExecuteTime": { "end_time": "2026-06-18T12:01:34.579760300Z", "start_time": "2026-06-18T12:01:30.535490300Z" } }, "source": [ "standardized_data = eet.read(\n", " input_path=str(Path.cwd().parent.parent / \"res\" / \"raw_data_from_cyclers\" / \"Cal_Ageing_Checkup1.xlsx\"),\n", " config=eet.ReadConfig.Neware_8_0_0_516,\n", ")" ], "outputs": [], "execution_count": 3 }, { "cell_type": "code", "id": "3af661b19a4db93b", "metadata": { "ExecuteTime": { "end_time": "2026-06-18T12:01:35.050036200Z", "start_time": "2026-06-18T12:01:34.581272800Z" } }, "source": [ "segmented_data = eet.add_primitive_segments(\n", " df=standardized_data,\n", " config=eet.PrimitiveConfig.DEFAULT,\n", ")" ], "outputs": [], "execution_count": 4 }, { "cell_type": "code", "id": "9186effcd32669ee", "metadata": { "ExecuteTime": { "end_time": "2026-06-18T12:01:35.068463500Z", "start_time": "2026-06-18T12:01:35.050036200Z" } }, "source": [ "eet.BatteryConfig.DEFAULT" ], "outputs": [ { "data": { "text/plain": [ "_BatteryConfigClass(cell_name='Default', c_ref=4.8, soc_start=0, max_voltage=4.2, min_voltage=2.5, threshold_current=0.075, voltage_intervall=0.01, minimal_current_for_capacity=-1.2, maximal_current_for_capacity=-0.8, min_current_diff=0.5, max_time_diff=0.5, min_voltage_diff=0, ignore_negative_resistance_values=False)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 5 }, { "cell_type": "markdown", "id": "3ce5298b8a8f6a8e", "metadata": {}, "source": "## Step 1: add_soc" }, { "cell_type": "code", "id": "7670108f21833e18", "metadata": { "ExecuteTime": { "end_time": "2026-06-18T12:01:36.275308Z", "start_time": "2026-06-18T12:01:35.069615300Z" } }, "source": [ "df = eet.add_soc(\n", " df=standardized_data,\n", " df_primitives=segmented_data,\n", " config=eet.BatteryConfig.DEFAULT,\n", " methods=[\n", " eet.SocMethod.WITHOUT_RESET,\n", " eet.SocMethod.WITH_RESET_WHEN_EMPTY,\n", " eet.SocMethod.WITH_RESET_WHEN_FULL,\n", " eet.SocMethod.WITH_RESET_WHEN_FULL_AND_EMPTY,\n", " ],\n", " verbose=True,\n", ")" ], "outputs": [], "execution_count": 6 }, { "cell_type": "code", "id": "added_cols_15", "metadata": { "ExecuteTime": { "end_time": "2026-06-18T12:01:36.292867900Z", "start_time": "2026-06-18T12:01:36.281935300Z" } }, "source": [ "added_cols = [c for c in df.columns if c not in standardized_data.columns]\n", "added_cols" ], "outputs": [ { "data": { "text/plain": [ "['Capacity[Ah]',\n", " 'SOC_WITHOUT_RESET',\n", " 'SOC_WITH_RESET_WHEN_EMPTY',\n", " 'SOC_WITH_RESET_WHEN_FULL',\n", " 'SOC_WITH_RESET_WHEN_FULL_AND_EMPTY']" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 7 }, { "metadata": {}, "cell_type": "markdown", "source": [ "