How to use the impedance.models.circuits.fitting.calculateCircuitLength function in impedance

To help you get started, we’ve selected a few impedance examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ECSHackWeek / impedance.py / impedance / models / circuits / circuits.py View on Github external
initial_guess: numpy array
            Initial guess of the circuit values

        CPE: boolean
            Use a constant phase element instead of a capacitor
        """
        super().__init__(**kwargs)

        if CPE:
            self.name = 'Randles w/ CPE'
            self.circuit = 'R0-p(R1,CPE1)-Wo1'
        else:
            self.name = 'Randles'
            self.circuit = 'R0-p(R1,C1)-Wo1'

        circuit_len = calculateCircuitLength(self.circuit)

        assert len(self.initial_guess) + len(self.constants) == circuit_len, \
            'The number of initial guesses + ' + \
            'the number of constants ({})'.format(len(self.initial_guess)) + \
            ' needs to be equal to ' + \
            'the circuit length ({})'.format(circuit_len)
github ECSHackWeek / impedance.py / impedance / models / circuits / circuits.py View on Github external
Notes
        -----
        A custom circuit is defined as a string comprised of elements in series
        (separated by a `-`) and elements in parallel (grouped as (x,y)).
        Elements with two or more parameters are separated by a forward slash
        (`/`).

        Example:
            Randles circuit is given by 'R0-p(R1,C1)-W1/W2'

        """

        super().__init__(**kwargs)
        self.circuit = circuit

        circuit_len = calculateCircuitLength(self.circuit)

        assert len(self.initial_guess) + len(self.constants) == circuit_len, \
            'The number of initial guesses + ' + \
            'the number of constants ({})'.format(len(self.initial_guess)) + \
            ' needs to be equal to ' + \
            'the circuit length ({})'.format(circuit_len)
github ECSHackWeek / impedance.py / impedance / models / circuits / __init__.py View on Github external
initial_guess: numpy array
            Initial guess of the circuit values

        CPE: boolean
            Use a constant phase element instead of a capacitor
        """
        super().__init__(**kwargs)

        if CPE:
            self.name = 'Randles w/ CPE'
            self.circuit = 'R0-p(R1,E1)-W1'
        else:
            self.name = 'Randles'
            self.circuit = 'R0-p(R1,C1)-W1'

        circuit_len = calculateCircuitLength(self.circuit)

        assert len(self.initial_guess) + len(self.constants) == circuit_len, \
            'The number of initial guesses + ' + \
            'the number of constants ({})'.format(len(self.initial_guess)) + \
            ' needs to be equal to ' + \
            'the circuit length ({})'.format(circuit_len)
github ECSHackWeek / impedance.py / impedance / models / circuits / __init__.py View on Github external
Notes
        -----
        A custom circuit is defined as a string comprised of elements in series
        (separated by a `-`) and elements in parallel (grouped as (x,y)).
        Elements with two or more parameters are separated by a forward slash
        (`/`).

        Example:
            Randles circuit is given by 'R0-p(R1,C1)-W1/W2'

        """

        super().__init__(**kwargs)
        self.circuit = circuit

        circuit_len = calculateCircuitLength(self.circuit)

        assert len(self.initial_guess) + len(self.constants) == circuit_len, \
            'The number of initial guesses + ' + \
            'the number of constants ({})'.format(len(self.initial_guess)) + \
            ' needs to be equal to ' + \
            'the circuit length ({})'.format(circuit_len)