Content
# EIS ECM DRT MCP
[English](#eis-ecm-drt-mcp) |
This project is an MCP server for batch EIS analysis. It reads EIS files or folders and outputs ECM fitting parameters, DRT curves, reconstructed impedance data, summaries, and optional plots.
The project keeps a two-layer structure:
- `eis_ecm_drt/`: core algorithms, including column detection, ECM fitting, DRT inversion, plotting, and batch output.
- `eis_ecm_drt/mcp_server.py`: a thin MCP interface layer that validates user selections and calls the core algorithms.
If you need to fix or improve the algorithm later, edit the core code under `eis_ecm_drt/`, then restart the MCP server.
## Features
- Batch processing for `.xlsx`, `.xls`, `.csv`, `.tsv`, and `.txt` files.
- Automatic detection of frequency, real impedance, and imaginary impedance columns.
- Automatic imaginary-sign normalization. Output uses the `-Zimag` convention while also preserving the physical imaginary impedance column.
- Four primary ECM models, plus custom equivalent-circuit expressions.
- DRT parameters must be explicitly selected or approved by the user.
- Outputs ECM parameters, DRT curves, fitting data, summary CSV files, and optional PNG plots.
- Default output folder is a new subfolder under desktop `EIS Analysis output`, so the input data folder stays clean.
## From GitHub To Installation
Clone the repository:
```powershell
git clone <your GitHub repository URL>
cd <project folder>
```
If you already have the source code locally, enter the project root directly, for example:
```powershell
cd C:\Users\wzd\Documents\电池软件
```
Python 3.10 or newer is recommended:
```powershell
py -3.10 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -U pip
.\.venv\Scripts\python.exe -m pip install -e ".[mcp]"
```
You can also use the bundled one-click script. On first run, it creates `.venv` and installs dependencies:
```powershell
.\run_mcp.cmd
```
Command-line analysis example:
```powershell
.\eis-analysis.cmd "test_cases/demo_eis/demo_eis.csv" --ecm-model L-R0-RQ-W --no-plots
```
## Start MCP
After installation, start the MCP server with:
```powershell
.\.venv\Scripts\eis-ecm-drt-mcp.exe
```
Or start it as a Python module:
```powershell
.\.venv\Scripts\python.exe -m eis_ecm_drt.mcp_server
```
Example MCP client configuration:
```json
{
"mcpServers": {
"eis-ecm-drt": {
"command": "C:\\path\\to\\EIS-Analysis-mcp\\run_mcp.cmd",
"args": []
}
}
}
```
Reusable config examples are also provided:
- `examples/mcp_config_windows.json`
- `examples/mcp_config_macos_linux.json`
After configuring the client, refresh or restart the MCP connection. If `eis-ecm-drt` appears as an available MCP server, the connection is ready.
## How To Use After MCP Is Connected
Once connected, you do not need to manually run command-line scripts. Ask your MCP client to call the tools exposed by this project.
Recommended workflow:
1. Call `list_ecm_models` and let the user choose one or more ECM models.
2. Call `list_drt_options` and let the user choose or approve DRT parameters.
3. If the input format is uncertain, call `validate_eis` or `validate_eis_batch` first.
4. For one file, call `analyze_eis_file`.
5. For batch processing, call `analyze_eis_batch`.
6. Open `README_输出说明.txt` and `batch_summary.csv` in the output folder.
By default, final results are written to the desktop:
```text
D:\desktop\EIS Analysis output\batch_YYYYMMDD_HHMMSS\
```
Each analysis creates a new subfolder under `EIS Analysis output`. The MCP response also includes `output_dir`, `readme_path`, and `summary_path`.
Example user request:
```text
Use eis-ecm-drt to analyze D:\desktop\EIS验证\温度估计_基础电池_txt.
I choose ECM model L-R0-RQ-W.
Use the recommended DRT configuration.
Batch process all files, automatically detect frequency, real, and imaginary columns, write final results to the desktop EIS Analysis output folder, and generate plots.
```
To compare multiple ECM models:
```text
Batch analyze D:\desktop\EIS验证\温度估计_基础电池_txt.
Fit and compare L-R0-RQ, L-R0-2RQ, L-R0-RQ-W, and L-R0-2RQ-W.
Use the recommended DRT configuration.
Write final results to the desktop EIS Analysis output folder.
```
Important: before formal analysis, the ECM model and DRT parameters must be explicit. The MCP server will not silently choose them for the user.
## MCP Tools
- `list_ecm_models`: list the four primary ECM models and custom-expression format.
- `list_drt_options`: list required DRT fields and the recommended configuration.
- `validate_eis`: validate one file or one in-memory EIS dataset.
- `validate_eis_batch`: validate multiple files, folders, or glob patterns.
- `fit_ecm`: fit one selected ECM model to one in-memory dataset.
- `calculate_drt`: calculate DRT using a user-selected DRT configuration.
- `analyze_eis_file`: analyze one EIS file.
- `analyze_eis_batch`: batch analyze files, folders, or glob patterns.
For `analyze_eis_file` and `analyze_eis_batch`, the caller must pass:
- `ecm_models`: one or more ECM model IDs or custom expressions.
- `drt_config`: a full DRT configuration dictionary.
- `ecm_models_confirmed_by_user: true`.
- `drt_config_confirmed_by_user: true`.
If these fields are missing, the MCP tool raises an error.
## ECM Model Choices
| Model ID | Name | Circuit Expression | Components |
| --- | --- | --- | --- |
| `L-R0-RQ` | CPE single-arc model | `L1-R0-(R1||CPE1)` | Inductance, ohmic resistance, one non-ideal polarization arc |
| `L-R0-2RQ` | Double CPE model | `L1-R0-(R1||CPE1)-(R2||CPE2)` | Inductance, ohmic resistance, two non-ideal polarization arcs |
| `L-R0-RQ-W` | Single arc with diffusion | `L1-R0-(R1-W1||CPE1)` | Inductance, ohmic resistance, one polarization arc, and diffusion |
| `L-R0-2RQ-W` | Double arc with diffusion | `L1-R0-(R1||CPE1)-(R2-W1||CPE2)` | Inductance, ohmic resistance, two arcs, with diffusion in the low-frequency arc |
Notes:
- `L1`: high-frequency inductance.
- `R0`: ohmic resistance.
- `R1/R2`: polarization or charge-transfer resistance.
- `CPE1/CPE2`: constant phase elements, output as `CPE*_Q` and `CPE*_n`.
- `W1`: Warburg diffusion impedance with one parameter in this implementation.
- `||`: parallel connection.
- `-`: series separator in the code expression, equivalent to `+` in circuit notation.
Custom expressions are also supported, for example:
```text
L1-R0-(R1||CPE1)-(R2-W1||CPE2)
```
## DRT Parameter Choices
Call `list_drt_options` first and let the user confirm the DRT configuration. The recommended commercial-aligned configuration is:
```json
{
"lambda_value": 0.01,
"n_tau": 750,
"regularization_order": 1,
"basis_function": "gaussian",
"shape_factor": 0.72,
"n_basis": 220,
"polarization_removal": "ignore_polarization",
"boundary_suppression_factor": 0.10,
"nonnegative": true,
"fit_r_inf": true,
"fit_inductance": true,
"weighting": "modulus"
}
```
Parameter notes:
- `lambda_value`: regularization strength.
- `n_tau`: number of DRT output points.
- `regularization_order`: derivative regularization order. Commercial setting is first order.
- `basis_function`: recommended value is `gaussian`.
- `shape_factor`: Gaussian basis width. The current `0.72` is calibrated against the provided commercial DRT curves.
- `n_basis`: internal number of Gaussian coefficients. Recommended value is `220`; output still has `n_tau=750` points.
- `polarization_removal`: recommended value is `ignore_polarization`.
- `boundary_suppression_factor`: boundary suppression strength. Recommended value is `0.10`.
- `fit_inductance`: whether to fit high-frequency inductance.
- `weighting`: recommended value is `modulus`.
## Batch Analysis Example
Example MCP call for `analyze_eis_batch`:
```json
{
"inputs": ["D:/desktop/EIS验证/温度估计_基础电池_txt"],
"recursive": false,
"ecm_models": ["L-R0-RQ-W"],
"ecm_models_confirmed_by_user": true,
"drt_config": {
"lambda_value": 0.01,
"n_tau": 750,
"regularization_order": 1,
"basis_function": "gaussian",
"shape_factor": 0.72,
"n_basis": 220,
"polarization_removal": "ignore_polarization",
"boundary_suppression_factor": 0.10,
"nonnegative": true,
"fit_r_inf": true,
"fit_inductance": true,
"weighting": "modulus"
},
"drt_config_confirmed_by_user": true,
"make_plots": true,
"continue_on_error": true
}
```
If `output_dir` is not provided, results are written to:
```text
D:\desktop\EIS Analysis output\batch_YYYYMMDD_HHMMSS\
```
## Input Data Rules
Recommended data columns:
| Frequency | Real Part | Imaginary Part |
| --- | --- | --- |
| `freq_hz` | `z_real_ohm` | `z_imag_ohm` |
Headerless files are also supported. The program detects the frequency column using numeric features such as positive values, wide logarithmic range, and approximate monotonic ordering. After finding the frequency column, it prefers the next two adjacent columns as real and imaginary impedance.
Imaginary sign is normalized to the `-Zimag` convention:
- If the low-frequency imaginary values are positive, the source data is treated as already using `-Zimag`.
- If the low-frequency imaginary values are negative, the source data is treated as physical `Zimag` and is multiplied by `-1` for output display.
Internal calculations still use physical complex impedance: `Z = Zreal + j Zimag`.
## Output Files
Each sample may output:
- `README_output_guide.txt`: output folder guide. Open this first.
- `*_ecm_params.csv`: ECM parameters.
- `*_ecm_compare.csv`: fitting metrics for multiple ECM candidates.
- `*_drt.csv`: DRT curve.
- `*_fit.csv`: original EIS, ECM reconstruction, and DRT reconstruction.
- `*_summary.csv`: single-sample summary.
- `*_nyquist.png`: Nyquist plot.
- `*_bode.png`: Bode plot.
- `*_drt.png`: DRT plot.
Batch jobs also output:
- `batch_summary.csv`
## Local Debugging
Run the smoke test:
```powershell
C:\ProgramData\Anaconda3\python.exe tests\smoke_test.py
```
Simulate an MCP batch call:
```powershell
C:\ProgramData\Anaconda3\python.exe examples\debug_mcp_batch.py
```
Run the core algorithm from the command line:
```powershell
C:\ProgramData\Anaconda3\python.exe -m eis_ecm_drt "test_cases/demo_eis/demo_eis.csv" `
--ecm-model L-R0-RQ-W `
--drt-lambda 0.01 `
--n-tau 750 `
--regularization-order 1 `
--basis-function gaussian `
--shape-factor 0.72 `
--n-basis 220 `
--boundary-suppression-factor 0.10 `
--polarization-removal ignore_polarization `
--fit-inductance `
--no-plots
```
## Python API
```python
from eis_ecm_drt import DRTConfig, ECMConfig, analyze_file
result = analyze_file(
"test_cases/demo_eis/demo_eis.csv",
ecm_config=[ECMConfig(model="L-R0-RQ-W")],
drt_config=DRTConfig(
lambda_value=0.01,
n_tau=750,
regularization_order=1,
basis_function="gaussian",
shape_factor=0.72,
n_basis=220,
polarization_removal="ignore_polarization",
boundary_suppression_factor=0.10,
fit_inductance=True,
),
make_plots=False,
)
print(result["ecm"].parameters)
print(result["drt"].tau, result["drt"].gamma)
```
## License
This project is licensed under the MIT License. See [LICENSE](LICENSE).
---
# Tool List
[English](#tool-list)
This is an MCP server for batch EIS data analysis. Input is EIS files or folders, output is ECM parameters, DRT curves, fitted reconstruction data, and plots.
The project maintains a two-layer structure:
- `eis_ecm_drt/`: core algorithms, including column identification, ECM fitting, DRT inversion, and batch output.
- `eis_ecm_drt/mcp_server.py`: thin MCP interface layer, responsible for receiving parameters, validating user choices, and calling core algorithms.
If algorithm issues are found, directly modify the source code in `eis_ecm_drt/` and restart the MCP server.
## Features
- Batch processing of `.xlsx`, `.xls`, `.csv`, `.tsv`, `.txt`
- Automatic identification of frequency, real part, and imaginary part columns
- Automatic unification of imaginary part signs, output using `-Zimag` convention, while maintaining physical imaginary part columns
- ECM supports four main models and custom equivalent circuit expressions
- DRT parameters must be explicitly selected by the user
- Output ECM parameters, DRT curves, fitted curves, summary CSV, and optional PNG plots for each sample
- Default output to a new subfolder under `EIS Analysis output` on the desktop, without polluting the input data directory
## From GitHub to Installation
If the project is already uploaded to GitHub, clone the code to your local machine:
```powershell
git clone <your GitHub repository address>
cd <project folder>
```
If you already have local source code, directly enter the project root directory, for example:
```powershell
cd C:\Users\wzd\Documents\电池软件
```
It is recommended to use Python 3.10 or higher:
```powershell
py -3.10 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -U pip
.\.venv\Scripts\python.exe -m pip install -e ".[mcp]"
```
You can also use the one-click script provided in the repository. The first run will automatically create `.venv` and install dependencies:
```powershell
.\run_mcp.cmd
```
Command-line analysis can be performed using:
```powershell
.\eis-analysis.cmd "test_cases/demo_eis/demo_eis.csv" --ecm-model L-R0-RQ-W --no-plots
```
If you only need to debug the core algorithm, you can also run it using an existing Python environment:
```powershell
C:\ProgramData\Anaconda3\python.exe tests\smoke_test.py
```
## Start MCP
After installation, you can start it directly:
```powershell
.\.venv\Scripts\eis-ecm-drt-mcp.exe
```
You can also start it using the module:
```powershell
.\.venv\Scripts\python.exe -m eis_ecm_drt.mcp_server
```
MCP client configuration example:
```json
{
"mcpServers": {
"eis-ecm-drt": {
"command": "C:\\Users\\wzd\\Documents\\电池软件\\.venv\\Scripts\\python.exe",
"args": ["-m", "eis_ecm_drt.mcp_server"],
"cwd": "C:\\Users\\wzd\\Documents\\电池软件"
}
}
}
```
A configurable template is also provided in the repository:
- `examples/mcp_config_windows.json`
- `examples/mcp_config_macos_linux.json`
After configuration, refresh or restart the connection in the MCP client. If you see the `eis-ecm-drt` MCP service available, it means you have connected successfully.
## How to Use MCP
After a successful connection, you don't need to manually run command lines. When you propose a request in an MCP client that supports it, the client will call the MCP tool exposed by this project.
Recommended workflow:
1. Call `list_ecm_models` to let the user select the ECM model.
2. Call `list_drt_options` to let the user select or confirm DRT parameters.
3. If unsure about the input file format, call `validate_eis` or `validate_eis_batch` to check column identification results.
4. For single-file analysis, call `analyze_eis_file`.
5. For batch analysis, call `analyze_eis_batch`.
6. Open `README_output_guide.txt` and `batch_summary.csv` in the output directory to view results.
The final results are defaulted to the desktop:
```text
D:\desktop\EIS Analysis output\batch_YYYYMMDD_HHMMSS\
```
A new subfolder is created in `EIS Analysis output` for each analysis. The MCP return result also includes `output_dir`, `readme_path`, and `summary_path`, where `readme_path` is the recommended first file to open.
You can tell the MCP client:
```text
Please use eis-ecm-drt to analyze D:\desktop\EIS验证\温度估计_基础电池_txt.
ECM model I choose is L-R0-RQ-W.
DRT parameters use recommended configuration.
Batch processing, automatic identification of frequency, real part, and imaginary part columns, and output results to the desktop EIS Analysis output folder with plots.
```
If you want to compare multiple ECM models, you can say:
```text
Please batch analyze D:\desktop\EIS验证\温度估计_基础电池_txt.
ECM models are L-R0-RQ, L-R0-2RQ, L-R0-RQ-W, L-R0-2RQ-W, all fitted and compared.
DRT parameters use recommended configuration.
Output results to the desktop EIS Analysis output folder.
```
Note: Before formal analysis, ECM models and DRT parameters must be confirmed. MCP will not automatically select them; if not passed during the call, it will directly report an error.
## MCP Tools
The formal MCP exposes these tools:
- `list_ecm_models`: List four main ECM models and custom model writing methods.
- `list_drt_options`: List required DRT parameters and recommended configurations.
- `validate_eis`: Validate single-file or array data and return automatically identified columns and cleaned EIS.
- `validate_eis_batch`: Batch validation of folders, wildcards, or file lists.
- `fit_ecm`: Fit a user-selected ECM model for array data.
- `calculate_drt`: Calculate DRT for array data according to user-selected DRT parameters.
- `analyze_eis_file`: Analyze an EIS file.
- `analyze_eis_batch`: Batch analyze files, folders, or wildcards.
Important rules:
`analyze_eis_file` and `analyze_eis_batch` will not select ECM or DRT for the user. Before calling, the user must choose:
- `ecm_models`: One or more ECM model IDs or custom expressions
- `drt_config`: Complete DRT parameter dictionary
- `ecm_models_confirmed_by_user: true`: Confirm the ECM model is selected by the user
- `drt_config_confirmed_by_user: true`: Confirm the DRT parameters are selected or approved by the user
If these choices or confirmation fields are missing, MCP will directly report an error.
## ECM Model Selection
Main models are:
| Model ID | Model Name | Equivalent Circuit Expression | Main Components |
| --- | --- | --- | --- |
| `L-R0-RQ` | CPE Single-Arc Model | `L1-R0-(R1||CPE1)` | Inductance, Ohmic resistance, one non-ideal polarization arc |
| `L-R0-2RQ` | Dual CPE Model | `L1-R0-(R1||CPE1)-(R2||CPE2)` | Inductance, Ohmic resistance, two non-ideal polarization arcs |
| `L-R0-RQ-W` | Single-Arc Model with Diffusion | `L1-R0-(R1-W1||CPE1)` | Inductance, Ohmic resistance, one polarization arc, and diffusion process |
| `L-R0-2RQ-W` | Dual-Arc Model with Diffusion | `L1-R0-(R1||CPE1)-(R2-W1||CPE2)` | Inductance, Ohmic resistance, two polarization arcs, one with diffusion process |
Where:
- `L1`: High-frequency inductance
- `R0`: Ohmic resistance
- `R1/R2`: Polarization or charge transfer resistance
- `CPE1/CPE2`: Constant phase elements, output parameters are `CPE*_Q` and `CPE*_n`
- `W1`: Warburg diffusion impedance, currently implemented with a single parameter
- `||`: Parallel connection
- `-`: Series separator in code expressions, equivalent to `+` in circuit diagrams
Users can also pass custom expressions, such as:
```text
L1-R0-(R1||CPE1)-(R2-W1||CPE2)
```
## DRT Parameter Selection
Call `list_drt_options` to let the user confirm DRT parameters. The recommended configuration aligned with commercial software is:
```json
{
"lambda_value": 0.01,
"n_tau": 750,
"regularization_order": 1,
"basis_function": "gaussian",
"shape_factor": 0.72,
"n_basis": 220,
"polarization_removal": "ignore_polarization",
"boundary_suppression_factor": 0.10,
"nonnegative": true,
"fit_r_inf": true,
"fit_inductance": true,
"weighting": "modulus"
}
```
Description:
- `lambda_value`: Regularization strength
- `n_tau`: DRT output points
- `regularization_order`: Derivative regularization order, commercially set to first order
- `basis_function`: Basis function, recommended `gaussian`
- `shape_factor`: Gaussian basis function width; the `0.72` here is an equivalent calibration value for commercial curves in this implementation
- `n_basis`: Internal Gaussian basis function coefficients solved; recommended `220`, output still has `n_tau=750` points; set to `null` or command line `--n-basis 0` to return to the old full 750 coefficient solution
- `polarization_removal`: Polarization processing, recommended `ignore_polarization`
- `boundary_suppression_factor`: Boundary polarization suppression strength; recommended `0.10`
- `fit_inductance`: Whether to fit high-frequency inductance
- `weighting`: Fitting weighting method, recommended `modulus`
## Batch Analysis Example
MCP calls `analyze_eis_batch` with the following parameters:
```json
{
"inputs": ["D:/desktop/EIS Validation/Temperature Estimation_Basic Battery_txt"],
"recursive": false,
"ecm_models": ["L-R0-RQ-W"],
"ecm_models_confirmed_by_user": true,
"drt_config": {
"lambda_value": 0.01,
"n_tau": 750,
"regularization_order": 1,
"basis_function": "gaussian",
"shape_factor": 0.72,
"n_basis": 220,
"polarization_removal": "ignore_polarization",
"boundary_suppression_factor": 0.10,
"nonnegative": true,
"fit_r_inf": true,
"fit_inductance": true,
"weighting": "modulus"
},
"drt_config_confirmed_by_user": true,
"make_plots": true,
"continue_on_error": true
}
```
Comparing multiple ECM models:
```json
{
"inputs": ["D:/desktop/EIS Validation/Temperature Estimation_Basic Battery_txt"],
"ecm_models": ["L-R0-RQ", "L-R0-2RQ", "L-R0-RQ-W", "L-R0-2RQ-W"],
"ecm_models_confirmed_by_user": true,
"drt_config": {
"lambda_value": 0.01,
"n_tau": 750,
"regularization_order": 1,
"basis_function": "gaussian",
"shape_factor": 0.72,
"n_basis": 220,
"polarization_removal": "ignore_polarization",
"boundary_suppression_factor": 0.10,
"nonnegative": true,
"fit_r_inf": true,
"fit_inductance": true,
"weighting": "modulus"
},
"drt_config_confirmed_by_user": true,
"recursive": false,
"make_plots": false
}
```
If `output_dir` is not provided, the results will be written to:
```text
D:\desktop\EIS Analysis output\batch_YYYYMMDD_HHMMSS\
```
If `D:\desktop` does not exist, it will attempt to use the user's desktop directory. The default output will not be in the input data folder, and the final results will be placed in the `EIS Analysis output` directory on the desktop.
## Input Data Rules
Recommended files should contain at least three columns:
| Frequency | Real Part | Imaginary Part |
| --- | --- | --- |
| `freq_hz` | `z_real_ohm` | `z_imag_ohm` |
No header is required. The program will identify the frequency column based on numerical features:
- The frequency column is usually all positive numbers
- It spans multiple orders of magnitude
- It is roughly monotonic, e.g., from `0.01` to `1000`
- Once the frequency column is found, the next two adjacent columns are prioritized as the real and imaginary parts
The imaginary part will be unified into the `-Zimag` output specification:
- If the imaginary part is positive at low frequencies: assume the source data is already `-Zimag`
- If the imaginary part is negative at low frequencies: assume the source data is physical `Zimag` and automatically multiply by `-1`
Internal calculations still use physical complex impedance `Z = Zreal + j Zimag`.
## Output Files
Each sample will output:
- `README_Output Description.txt`: output directory description, recommended to open this file first
- `*_ecm_params.csv`: ECM parameters
- `*_ecm_compare.csv`: multiple ECM candidate models' fitting error comparison
- `*_drt.csv`: DRT curve
- `*_fit.csv`: original EIS, ECM reconstruction, DRT reconstruction
- `*_summary.csv`: single sample summary
- `*_nyquist.png`: Nyquist plot
- `*_bode.png`: Bode plot
- `*_drt.png`: DRT plot
Batch tasks will additionally output:
- `batch_summary.csv`
The file name prefix comes from the original EIS file name. The `cell_a` and `cell_b` in the example are just demo sample names and do not represent real battery numbers.
## Local Debugging
Generate example data:
```powershell
C:\ProgramData\Anaconda3\python.exe examples\make_demo_data.py
```
Run smoke test:
```powershell
C:\ProgramData\Anaconda3\python.exe tests\smoke_test.py
```
Simulate MCP batch call:
```powershell
C:\ProgramData\Anaconda3\python.exe examples\debug_mcp_batch.py
```
Run the core algorithm directly from the command line:
```powershell
C:\ProgramData\Anaconda3\python.exe -m eis_ecm_drt "examples/data/*.csv" `
--ecm-model L-R0-RQ-W `
--drt-lambda 0.01 `
--n-tau 750 `
--regularization-order 1 `
--basis-function gaussian `
--shape-factor 0.72 `
--n-basis 220 `
--boundary-suppression-factor 0.10 `
--polarization-removal ignore_polarization `
--fit-inductance `
--no-plots
```
## Commercial Software Alignment Loop
Development script:
[tools/commercial_alignment_loop.py](tools/commercial_alignment_loop.py)
It reads commercial DRT Excel, searches for DRT parameters in batches, and outputs the best configuration:
```powershell
C:\ProgramData\Anaconda3\python.exe tools\commercial_alignment_loop.py `
--input-dir "D:\desktop\EIS Validation\Temperature Estimation_Basic Battery_txt" `
--commercial-drt "D:\desktop\EIS Validation\Basic Battery_DRT_Raw Data.xlsx" `
--commercial-ecm "D:\desktop\EIS Validation\2.ECM Data.xlsx" `
--max-samples 60 `
--candidate-preset refine `
--evaluate-all
```
The current default DRT parameters come from the 200-sample verification results of this loop.
## Python API
```python
from eis_ecm_drt import DRTConfig, ECMConfig, analyze_file
result = analyze_file(
"examples/data/cell_a.csv",
ecm_config=[ECMConfig(model="L-R0-RQ-W")],
drt_config=DRTConfig(
lambda_value=0.01,
n_tau=750,
regularization_order=1,
basis_function="gaussian",
shape_factor=0.72,
n_basis=220,
polarization_removal="ignore_polarization",
boundary_suppression_factor=0.10,
fit_inductance=True,
),
make_plots=False,
)
print(result["ecm"].parameters)
print(result["drt"].tau, result["drt"].gamma)
```
## License
This project uses the MIT License, see [LICENSE](LICENSE).
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
No recommendations available