{"id":22745946,"url":"https://github.com/tumftm/ev_dva_tool","last_synced_at":"2025-07-23T10:02:02.613Z","repository":{"id":249664338,"uuid":"832087787","full_name":"TUMFTM/ev_dva_tool","owner":"TUMFTM","description":"This tool can be used to extract DVA curves from laboratory measurements. Both Matlab and Python code are provided in this repository.","archived":false,"fork":false,"pushed_at":"2024-07-22T11:50:50.000Z","size":33793,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T16:21:26.760Z","etag":null,"topics":["battery-aging","battery-diagnostics","dva","ica"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TUMFTM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-22T10:27:24.000Z","updated_at":"2025-02-28T14:46:07.000Z","dependencies_parsed_at":"2024-07-22T16:07:22.053Z","dependency_job_id":null,"html_url":"https://github.com/TUMFTM/ev_dva_tool","commit_stats":null,"previous_names":["tumftm/ev_dva_tool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2Fev_dva_tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2Fev_dva_tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2Fev_dva_tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2Fev_dva_tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TUMFTM","download_url":"https://codeload.github.com/TUMFTM/ev_dva_tool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248638531,"owners_count":21137678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["battery-aging","battery-diagnostics","dva","ica"],"created_at":"2024-12-11T02:09:28.428Z","updated_at":"2025-04-12T22:21:10.564Z","avatar_url":"https://github.com/TUMFTM.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EV DVA\n\nThis repository unites all the FTM EV Lab's Differential Voltage Analysis (DVA) tools in a single place for future publication (-\u003e Github) and use in scientific publications.\nThere is a version for MATLAB and one for Python.\n\n## Authors and acknowledgment\nThis code was created by Jonas Göhmann and Lukas Leonard Köning during their time as Student Assistants at the Institute of Automotive technology of the Technical University of Munich.\n\n## Features\n- Calculation of Differential Voltage Analysis (DVA) and Incremental Capacity Analysis (ICA)\n- Different smoothing methods\n- Different smoothing location (which data to smooth)\n- Noise detection with recommendations for smoothing parameter changes\n- Scripts for automatic DVA calculation for multiple files\n\n## How to run\n\n### Single file\nTo use the DVA Tool simply use the function `calcDVA(filepath, \"DVA\")`. Examples are shown below.\n\nTwo inputs are mandatory:\n- filepath = (string) path to input file\n- calculation method = (string) either \"DVA\" or \"ICA\"\n\nBelow you can find two examples:\n\n```python\noutput = calcDVA(filepath, \"DVA\")\noutput = calcDVA(\"C:\\Users\\(User_Name)\\Documents\\lib_discharge.csv\", \"ICA\")\n``` \n\n### Multiple files\nA second option is, to calculate the DVA of multiple files. Simply use\n- the `RunMe.m` file for MATLAB or\n- the `main.py` for Python.\n\nThese will calculate the DVA for all files within the `data_in` folder. The results will be saved either as .mat-file (MATLAB) or as .pickle-file (Python) in the `data_out` folder.\n\n### Options\nThe user can also add a number of additional input arguments to control\n- the smoothing method,\n- the amount of smoothing, \n- which data to smooth or \n- the output size. \n\nFor more details on this, please refer to the following section.\n\n## Input data\n__Matlab__: .mat-file or .csv-file containing a matrix with raw time, voltage and current data as separate columns\n\n__Python__: .csv-file containing a matrix with raw time, voltage and current data as separate columns\n\n### Required input variables:\n- Datapath: (string) file path to input file\n- Calculation method: (string) \"DVA\" or \"ICA\"\n\n### Optional input variables:\n\n- Smoothing Method: (string) what smoothing method one want to use, must be \"cubic\", \"sgolay\", \"movmean\" or \"spline\" (default: \"sgolay\")\n- Smoothing Parameter: (float) how much the data is smoothed (default: 0.04)\n- Smoothing Location: (string) which data should be smoothed, must be \"U\", \"I\", \"Output\" or \"all\" (default: \"all\")\n- Output Size: (integer) size of the output, must be smaller or equal of input size (default: input size)\n\nHow to define these options depends on the coding language. Following are examples for MATLAB and Python.\n\n#### MATLAB\n```python\nOutput = calcDVA(filepath, \"DVA\", \"Smoothing Method\", \"spline\", \"Smoothing Parameter\", 10, \"Smoothing Location\", \"all\", \"Output Size\", 1000)\n```\n\n#### Python\n```python\nDVA = calcDVA(\"../data_in/Samsung35E_CU0.csv\", \"DVA\", smoothing_method=\"sgolay\", smoothing_parameter=0.03, smoothing_location=\"all\")\n```\n\n## Output data\n\n__Matlab__: struct with time, DVA and normed DVA or ICA, charge, SOC\n\n__Python__: dictionary of numpy arrays with the same content as the Matlab struct\n\nThe output is always formatted as SOC 0-100% in positive x-axis regardless of whether the input was a discharge or charge measurement.\n\nThe result could look like on the follow image:\n\n![Example result of DVA-Tool](/assets/example_result.png)\n\n## Installation\nThe MATLAB code should run in all native MATLAB environments. To install the required packages for the python code, one could use the `requirements.txt`-file in the `python`-folder.\nFor development the following software versions were used:\n- MATLAB R2020b (tested also in R2022b).\n- Python 3.11\n\n## Documentation\nIn the following sections one can find more information on the tool and its implementation.\n\n### Smoothing\nDifferent smoothing options are implemented. The user can choose between cubic smoothing spline, Savitzky Golay, moving mean and a combination of spline smoothing and thining out the data.\n- cubic smoothing spline\n  - **method identifier**: \"cubic\"\n  - uses the cubic smoothing spline interpolation to smooth the given data\n  - **smoothing parameter** is a value between 0 and 1\n    - Values closer to 0 result in stronger smoothing with the extreme of a resulting straight line with a smoothing parameter of 0. \n    - Values closer to 1 will result in fewer smoothing with the extreme of the value 1 resulting in a cubic interpolation with no smoothing at all.\n- Savitzky Golay filter: \n  - **method identifier**: \"sgolay\"\n  - smooths according to a quadratic polynomial that is fitted over each window of the input data. \n  - **smoothing parameter** is a value between 0 and 1 (excluding 0)\n    - corresponds to the window size used for the smoothing algorithm. \n    - window size is calculated by `windowsize = smoothing paramter * length of the input data`. \n    - Values closer to 0 result in fewer smoothing, however 0 can not be used. \n    - Values closer to 1 will result in stronger smoothing with the extreme of the value 1 resulting in a straight line.\n- moving mean: \n  - **method identifier**: \"movmean\"\n  - moving average over each window of the input data\n  - **smoothing parameter** is a value between 0 and 1 (excluding 0)\n    - corresponds to the window size used for the smoothing algorithm. \n    - window size is calculated by `windowsize = smoothing paramter * length of the input data`\n    - Values closer to 0 result in fewer smoothing, however 0 can not be used. \n    - Values closer to 1 will result in stronger smoothing with the extreme of the value 1 resulting in a straight line.\n- spline filtering: \n  - **method identifier**: \"spline\"\n  - combination of thinning out the data by using every n_th datapoint and performing spline interpolation\n  - The interpolation is based on cubic spline. \n  - **smoothing parameter** corresponds to the n_th data point that will be used in the thinning out\n    - e.g. smoothing Parameter 5 = every 5th point of the input data will be used. \n    - All other data points will be deleted. \n    - value between 1 and the length of the inputdata\n    - The bigger the smoothing parameter, the more smoothing. \n    - Smoothing parameters around 10 will often result in usable smoothing.\n\n### Units\n\nThe DVA Tool accepts various units as input. However, the user has to keep in mind which units will result from the input. \n\nAs a help common input units and there corresponding output units are listed in the table below:\n\n| Input Unit                                          | Output Unit                                            | \n|-----------------------------------------------------|--------------------------------------------------------|\n| time in s\u003cbr /\u003evoltage U in V \u003cbr /\u003ecurrent I in mA | DVA in V/mAs\u003cbr /\u003eCharge in mAs \u003cbr /\u003eDVA_Qnormed in V |\n| time in h\u003cbr /\u003evoltage U in V \u003cbr /\u003ecurrent I in A  | DVA in V/Ah\u003cbr /\u003eCharge in Ah \u003cbr /\u003eDVA_Qnormed in V   |\n\n### Open tasks\n- [ ] Adaption of the LAB2MAT script, such that it outputs the data in the correct input format for this tool\n- [ ] Expand tool to pack DVA (--\u003e number series and parallel cells)\n- [ ] Add discussion of smoothing methods\n- [ ] second derivative of DVA\n- [ ] Input of Q0 for DVA scaling\n- [ ] Smoothing option for ICA (first smooth DVA then calculate ICA and not smooth ICA)\n\n### Literature\n\n| Author            | Title                                                                                                               | Year | DOI                                            | short description  |\n|-------------------|---------------------------------------------------------------------------------------------------------------------|------|------------------------------------------------|--------------------|\n| I. Bloom et al.   | Differential voltage analyses of highpower, lithium-ion cells: 1. technique and application                         | 2005 | https://doi.org/10.1016/j.jpowsour.2004.07.021 | Method description |\n| H. M. Dahn et al. | User-friendly differential voltage analysis freeware for the analysis of degradation mechanisms in li-ion batteries | 2012 | https://doi.org/10.1149/2.013209jes            | Application        |\n| M. Dubarry et al. | Best practices for incremental capacity analysis                                                                    | 2022 | https://doi.org/10.3389/fenrg.2022.1023555     | ICA Application    |\n\n## License\n GNU GENERAL PUBLIC LICENSE\n\n## Project status\nThis repository includes working implementations of the DVA tool for MATLAB and Python (2022-02-23).\nFurther work and documentation should be done according to the `Open tasks` section of the documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftumftm%2Fev_dva_tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftumftm%2Fev_dva_tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftumftm%2Fev_dva_tool/lists"}