eisgenerator is a shared library (libeisgenerator.so) and CLI application that allows one to generate EIS spectra with high performance.
  • C++ 52%
  • C 45.4%
  • CMake 1.6%
  • Shell 1%
Find a file
2026-10-02 11:34:22 +02:00
argp add license headers 2024-01-08 14:50:46 +01:00
componant Add function to tell if a model was inited with default paramters 2026-10-02 11:34:22 +02:00
dlfcn-win32 add missing dlfcn files for windows 2024-02-05 10:14:36 +01:00
doc Improve documentation 2026-09-29 23:44:16 +02:00
eisgenerator Add function to tell if a model was inited with default paramters 2026-10-02 11:34:22 +02:00
examples add some more documentation 2024-01-09 11:53:09 +01:00
pkgconfig fix mising variable in pkgconfig file 2024-02-05 14:37:47 +01:00
.gitmodules componants: rename getDefaultRange to getDefaultParameters 2023-11-06 13:42:25 +01:00
accumplot.sh add license headers 2024-01-08 14:50:46 +01:00
basicmath.cpp Port to use libkisstype 2024-10-08 15:28:53 +02:00
bench.cpp add benchmark 2025-03-06 14:03:01 +01:00
CMakeLists.txt Add permutation dection function 2026-09-28 19:11:28 +02:00
compcache.cpp include the readme in the doxygen documentation 2024-01-09 11:09:59 +01:00
compcache.h Port to use libkisstype 2024-10-08 15:28:53 +02:00
compile-win.cpp Remove unessecary includes in compile-win stub 2024-06-18 10:07:53 +02:00
compile.cpp Remove unessecary includes in compile-win stub 2024-06-18 10:07:53 +02:00
compile.h add license headers 2024-01-08 14:50:46 +01:00
crossW64.cmake Build windows for win64 platform instead of win32, improve documentation 2023-07-25 13:03:36 +02:00
density.p eisgenerator_export: print an eisfile to stdout instead of a custom format 2023-11-16 11:45:21 +01:00
gpl-3.0.txt add gpl text 2024-06-18 15:54:10 +02:00
kissplotcsv Add the ability to check if all elements of a spectra contribute 2025-02-17 17:45:23 +01:00
lgpl-3.0.txt include the readme in the doxygen documentation 2024-01-09 11:09:59 +01:00
linearregession.cpp include the readme in the doxygen documentation 2024-01-09 11:09:59 +01:00
linearregession.h Port to use libkisstype 2024-10-08 15:28:53 +02:00
log.cpp include the readme in the doxygen documentation 2024-01-09 11:09:59 +01:00
main.cpp Add permutation dection function 2026-09-28 19:11:28 +02:00
model.cpp Add function to tell if a model was inited with default paramters 2026-10-02 11:34:22 +02:00
normalize.cpp fix bug where the wrong datapoints where erased when reduing region 2024-10-14 17:12:38 +02:00
options.h Add permutation dection function 2026-09-28 19:11:28 +02:00
package-win.sh windows packageing: add headers 2024-06-18 16:06:27 +02:00
randomgen.cpp include the readme in the doxygen documentation 2024-01-09 11:09:59 +01:00
randomgen.h include the readme in the doxygen documentation 2024-01-09 11:09:59 +01:00
README.md Add permutation dection function 2026-09-28 19:11:28 +02:00
strops.cpp add removeSeriesResitance 2024-09-30 12:05:29 +02:00
strops.h add removeSeriesResitance 2024-09-30 12:05:29 +02:00
symmetry.cpp Add permutation dection function 2026-09-28 19:11:28 +02:00
test.cpp Add function to tell if a model was inited with default paramters 2026-10-02 11:34:22 +02:00
translators.cpp Port to use libkisstype 2024-10-08 15:28:53 +02:00

eisgenerator

eisgenerator is a shared library (libeisgenerator.so) and CLI application that allows one to generate EIS spectra with high performance. The target application is generating test and example datasets for machine learning applications.

eisgenerator's development and target platform is UNIX, but it should compile on nigh on any platform

Compile/Install

Requirements

  • git
  • c++20 capable compiler (GCC, CLANG)
  • cmake 3.20 or later
  • optional:
    • gnuplot in $PATH

Procedure (UNIX)

In a console do:

Cross-compile for windows on UNIX

Basic usage of CLI application

Generate spectra

eisgenerator_export --model="r{1e3}-r{100}c{1e-6}" --omega=1-1e6 --omegasteps=100

flags:

--model: model string, format is similar to RHD RelaxIS except that the implicit operator is parallel instead of serial, IE. "rc" is a resistor and condenser in parallel while "r-c" is the same in series and that parameters can be passed by adding {number} after the parameter, if an element requires more than one parameter they are specified by adding several comma separated values in between the brackets like so: {420, 56}

  • Supported Elements
    • c: capacitor
      • one parameter: capacitance {C}
    • r: resistor
      • one parameter: resistance {R}
    • l: inductor
      • one parameter: inductance {L}
    • w: warburg element (infinite)
      • one parameter: Warburg coefficient {A}
    • p: constant phase element
      • two parameters: {Q, alpha}
    • t: closed transmititon line
      • four parameters: {R, Q, a, l}
    • o: open (reflecting) transmititon line
      • four parameters: {R, Q, a, l}

--omega: range of frequency values (in rad/s) to sweep

--omegasteps: amount of steps to take in the range specified by --omega

Ranges and parameter sweeps

Instead of a single value, a parameter can be given as a range: start~end steps it linearly, start~endL logarithmically. As soon as one element carries a range the model becomes a parameter sweep over the cross product of all ranges, and --param sets how many steps every range gets.

A single range can override that with its own step count, appended after a colon:

eisgenerator_export --model="r{101e5L:8}p{1e-91e-6L:12, 0.6~0.95:3}"

Here r gets 8 steps, Q 12 and alpha 3, regardless of --param. This is how to spend steps where they matter: the CPE exponent is the least sensitive parameter in a model string, Y0 among the most, and the total cost is the product of all counts. find-range prints the counts it used, so its output can be fed back in unchanged.

find-range also probes each parameter on its own (all others parked at the centre of their range) and reports how far the spectra travel in decades of |Z| as that one parameter sweeps. From that it derives how many steps each parameter needs to stay resolved, and prints a paste-ready model string carrying those counts. When fully resolving every parameter would cost more spectra than the sweep you asked for, the counts are scaled down together to fit the budget and a warning explains that the counts are a floor: prefer narrowing the widest ranges over cutting counts below it.

further flags can be found with: eisgenerator_export --help

Equivalent parameter permutations

Many models have parameter assignments that produce exactly the same spectrum. In

eisgenerator_export --model="r{100}c{1e-6}-r{333}c{1e-9}" --mode=permutations

the two rc groups can be exchanged, so the tool prints

r{333}c{1e-09}-r{100}c{1e-06}

These are parameter symmetries: values move between the slots of the same model string. Exchanging two elements that keep their own values, r{100}c{1e-6} for c{1e-6}r{100}, is only a relabelling of the topology and is not reported.

What is interchangeable is decided by fitting each element's parameters to the other's impedance curve and requiring the residual to stay under --permutation-tolerance (1e-3 by default), then confirming every reported permutation against the spectrum of the whole circuit. That catches the cases a structural comparison would miss:

  • a CPE standing in for a capacitor at alpha=1, for a Warburg at alpha=0.5 and for a resistor at alpha=0, so r{100}p{1e-6,1}-r{333}c{1e-9} has one permutation and r{100}p{1e-6,0.9}-r{333}c{1e-9} has none
  • nested groups, which are flattened first because series and parallel are associative, so r{1}-(r{2}-r{3}) reports all 6 orderings of the three resistances rather than just the inner pair
  • combinations, so (r{1}-r{2})(r{3}-r{4}) reports 7: swap either pair, or both, or the two serials

Cost is a few dozen circuit evaluations regardless of the model, plus one per reported permutation; the count itself grows factorially with the size of a symmetric group, so --mode=permutations stops after 4096 candidates and says so. For a sweep model the values are taken from sweep step 0, which is representative since symmetry does not depend on the values.

Useful for generating training data: every permutation printed is a distinct label for a spectrum a fit cannot tell apart, so either deduplicate against this list or expect the fit to land on any one of them.

The same is available from the library as eis::Model::getEquivalentParameterPermutations().

Plot Spectra

requires gnuplot in $PATH

eisgenerator_plot --model="r{1e3}-r{100}c{1e-6}" --omega=1-1e6 --log --omegasteps=100

Generates Nyquist plot of model specified, allows the usage of the same flags as eisgenerator_export

Linking

it is best to link to this library with the help of pkg-config as this provides platform a agnostic to query for paths and flags. Almost certainly, pkg-config is already integrated into your buildsystem.

Python bindings

python bindings can be build separately from: eisgeneratorpy