Mixed Mode
This submodule contains the Mixed Mode (MM) method and Stage classes.
See this link for an example how to set it up.
pypalmsens.mixed_mode
Classes:
-
MixedMode–Create mixed mode method parameters.
-
ConstantE–Amperometric detection stage.
-
ConstantI–Potentiometry stage.
-
SweepE–Linear sweep detection stage.
-
OpenCircuit–Open Circuit stage.
-
Impedance–Electostatic impedance stage.
MixedMode
Create mixed mode method parameters.
Mixed mode is a flexible technique that allows for switching between potentiostatic, galvanostatic, and open circuit measurements during a single run.
The mixed mode uses different stages similar to the levels during Multistep Amperometry or Potentiometry, but each stage can be galvanostatic or potentiostatic independent of the previous stage.
The available stage types are ConstantE, ConstantI, SweepE, OpenCircuit and Impedance.
ConstantE: Apply constant potentialConstantI: Apply constant currentSweepE: potential linear sweep (ramp) similar to a regular LSV stepOpenCircuit: Measure the OCP valueImpedance: the impedance is measured by applying a small AC potential superimposed with a DC potential. This corresponds to an EIS single frequency step (scan_type = 'fixed',freq_type = 'fixed')
Each stage can use the previous stage’s potential as a reference point, for example, a constant current is applied for a fixed period and afterward, the reached potential is kept constant for a fixed period.
Furthermore, each stage can end because a fixed period has elapsed, or certain criteria are met. Available criteria include reaching a maximum current, minimum current, maximum potential, and minimum potential.
Methods:
-
to_dict–Return the technique instance as a new key/value dictionary mapping.
-
from_dict–Structure technique instance from dict.
-
from_method_id–Create new instance of appropriate technique from method ID.
Attributes:
-
general(General) –Sets general/other settings.
-
data_processing(DataProcessing) –Set the data processing settings.
-
post_measurement(PostMeasurement) –Set the post measurement settings.
-
pretreatment(Pretreatment) –Set the pretreatment settings.
-
current_range(CurrentRange) –Set the autoranging current.
-
id(Literal['mm']) –Unique method identifier.
-
interval_time(float) –Time between two samples in s.
-
cycles(int) –Number of times to go through all stages.
-
stages(list[StageType]) –List of stages to run through.
-
use_triggers–True if any of the stages has triggers set.
general
class-attribute
instance-attribute
Sets general/other settings.
data_processing
class-attribute
instance-attribute
data_processing: DataProcessing = Field(default_factory=DataProcessing)
Set the data processing settings.
post_measurement
class-attribute
instance-attribute
post_measurement: PostMeasurement = Field(default_factory=PostMeasurement)
Set the post measurement settings.
pretreatment
class-attribute
instance-attribute
pretreatment: Pretreatment = Field(default_factory=Pretreatment)
Set the pretreatment settings.
current_range
class-attribute
instance-attribute
current_range: CurrentRange = Field(default_factory=CurrentRange)
Set the autoranging current.
interval_time
class-attribute
instance-attribute
interval_time: float = 0.1
Time between two samples in s.
stages
class-attribute
instance-attribute
List of stages to run through.
use_triggers
property
use_triggers
True if any of the stages has triggers set.
to_dict
Return the technique instance as a new key/value dictionary mapping.
Source code in src/pypalmsens/_methods/base.py
30 31 32 | |
from_dict
classmethod
Structure technique instance from dict.
Opposite of .to_dict()
Source code in src/pypalmsens/_methods/base.py
34 35 36 37 38 39 | |
from_method_id
classmethod
from_method_id(id: str) -> BaseTechnique
Create new instance of appropriate technique from method ID.
Source code in src/pypalmsens/_methods/base.py
41 42 43 44 45 | |
ConstantE
Amperometric detection stage.
Apply constant potential during this stage.
Methods:
-
from_stage_type–Create new instance of appropriate stage from its type.
Attributes:
-
measurement_triggers(MeasurementTriggers) –Set the trigger at measurement settings.
-
current_limits(CurrentLimits) –Set the current limit settings.
-
stage_type(Literal['ConstantE']) –Stage type identifier.
-
potential(float) –Potential during measurement in V.
-
run_time(float) –Run time of the stage in s.
measurement_triggers
class-attribute
instance-attribute
measurement_triggers: MeasurementTriggers = Field(default_factory=MeasurementTriggers)
Set the trigger at measurement settings.
current_limits
class-attribute
instance-attribute
current_limits: CurrentLimits = Field(default_factory=CurrentLimits)
Set the current limit settings.
stage_type
class-attribute
instance-attribute
stage_type: Literal['ConstantE'] = 'ConstantE'
Stage type identifier.
potential
class-attribute
instance-attribute
potential: float = 0.0
Potential during measurement in V.
from_stage_type
classmethod
from_stage_type(id: str) -> BaseStage
Create new instance of appropriate stage from its type.
Source code in src/pypalmsens/_methods/mixed_mode.py
30 31 32 33 34 | |
ConstantI
Potentiometry stage.
Apply constant fixed current during this stage.
Methods:
-
from_stage_type–Create new instance of appropriate stage from its type.
Attributes:
-
measurement_triggers(MeasurementTriggers) –Set the trigger at measurement settings.
-
potential_limits(PotentialLimits) –Set the potential limit settings.
-
stage_type(Literal['ConstantI']) –Stage type identifier.
-
current(float) –The current to apply in the given current range.
-
applied_current_range(AllowedCurrentRanges) –Applied current range.
-
run_time(float) –Run time of the stage in s.
measurement_triggers
class-attribute
instance-attribute
measurement_triggers: MeasurementTriggers = Field(default_factory=MeasurementTriggers)
Set the trigger at measurement settings.
potential_limits
class-attribute
instance-attribute
potential_limits: PotentialLimits = Field(default_factory=PotentialLimits)
Set the potential limit settings.
stage_type
class-attribute
instance-attribute
stage_type: Literal['ConstantI'] = 'ConstantI'
Stage type identifier.
current
class-attribute
instance-attribute
current: float = 0.0
The current to apply in the given current range.
Note that this value acts as a multiplier in the applied current range.
So if 10 uA is the applied current range and 1.5 is given as current value, the applied current will be 15 uA.
applied_current_range
class-attribute
instance-attribute
applied_current_range: AllowedCurrentRanges = '100uA'
Applied current range.
See pypalmsens.settings.AllowedCurrentRanges for options.
from_stage_type
classmethod
from_stage_type(id: str) -> BaseStage
Create new instance of appropriate stage from its type.
Source code in src/pypalmsens/_methods/mixed_mode.py
30 31 32 33 34 | |
SweepE
Linear sweep detection stage.
Ramp the voltage from begin_potential to end_potential during this stage.
Methods:
-
from_stage_type–Create new instance of appropriate stage from its type.
Attributes:
-
measurement_triggers(MeasurementTriggers) –Set the trigger at measurement settings.
-
current_limits(CurrentLimits) –Set the current limit settings.
-
stage_type(Literal['SweepE']) –Stage type identifier.
-
begin_potential(float) –Potential where the scan starts in V.
-
end_potential(float) –Potential where the scan stops in V.
-
step_potential(float) –Potential step in V.
-
scanrate(float) –The applied scan rate. in V/s.
measurement_triggers
class-attribute
instance-attribute
measurement_triggers: MeasurementTriggers = Field(default_factory=MeasurementTriggers)
Set the trigger at measurement settings.
current_limits
class-attribute
instance-attribute
current_limits: CurrentLimits = Field(default_factory=CurrentLimits)
Set the current limit settings.
stage_type
class-attribute
instance-attribute
stage_type: Literal['SweepE'] = 'SweepE'
Stage type identifier.
begin_potential
class-attribute
instance-attribute
begin_potential: float = -0.5
Potential where the scan starts in V.
end_potential
class-attribute
instance-attribute
end_potential: float = 0.5
Potential where the scan stops in V.
scanrate
class-attribute
instance-attribute
scanrate: float = 1.0
The applied scan rate. in V/s.
The applicable range depends on the value of step_potential
since the data acquisition rate is limited by the connected
instrument.
from_stage_type
classmethod
from_stage_type(id: str) -> BaseStage
Create new instance of appropriate stage from its type.
Source code in src/pypalmsens/_methods/mixed_mode.py
30 31 32 33 34 | |
OpenCircuit
Open Circuit stage.
Measure the open circuit potential during this stage.
Methods:
-
from_stage_type–Create new instance of appropriate stage from its type.
Attributes:
-
measurement_triggers(MeasurementTriggers) –Set the trigger at measurement settings.
-
potential_limits(PotentialLimits) –Set the potential limit settings.
-
stage_type(Literal['OpenCircuit']) –Stage type identifier.
-
run_time(float) –Run time of the stage in s.
measurement_triggers
class-attribute
instance-attribute
measurement_triggers: MeasurementTriggers = Field(default_factory=MeasurementTriggers)
Set the trigger at measurement settings.
potential_limits
class-attribute
instance-attribute
potential_limits: PotentialLimits = Field(default_factory=PotentialLimits)
Set the potential limit settings.
stage_type
class-attribute
instance-attribute
stage_type: Literal['OpenCircuit'] = 'OpenCircuit'
Stage type identifier.
from_stage_type
classmethod
from_stage_type(id: str) -> BaseStage
Create new instance of appropriate stage from its type.
Source code in src/pypalmsens/_methods/mixed_mode.py
30 31 32 33 34 | |
Impedance
Electostatic impedance stage.
This is like EIS with a single frequency step
(scan_type = 'fixed', freq_type = 'fixed').
Methods:
-
from_stage_type–Create new instance of appropriate stage from its type.
Attributes:
-
stage_type(Literal['Impedance']) –Stage type identifier.
-
run_time(float) –Run time of the scan in s.
-
dc_potential(float) –DC potential applied during the scan in V.
-
ac_potential(float) –AC potential in V RMS.
-
frequency(float) –Fixed frequency in Hz.
-
min_sampling_time(float) –Minimum sampling time in s.
-
max_equilibration_time(float) –Max equilibration time in s.
stage_type
class-attribute
instance-attribute
stage_type: Literal['Impedance'] = 'Impedance'
Stage type identifier.
dc_potential
class-attribute
instance-attribute
dc_potential: float = 0.0
DC potential applied during the scan in V.
ac_potential
class-attribute
instance-attribute
ac_potential: float = 0.01
AC potential in V RMS.
The amplitude of the AC signal has a range of 0.0001 V to 0.25 V (RMS). In many applications, a value of 0.010 V (RMS) is used. The actual amplitude must be small enough to prevent a current response with considerable higher harmonics of the applied ac frequency.
min_sampling_time
class-attribute
instance-attribute
min_sampling_time: float = 0.5
Minimum sampling time in s.
Each measurement point of the impedance spectrum is performed
during the period specified by min_sampling_time.
This means that the number of measured sine waves is equal to min_sampling_time * frequency.
If this value is less than 1 sine wave, the sampling is extended to 1 / frequency.
So for a measurement at a frequency, at least one complete sine wave is measured.
Reasonable values for the sampling are in the range of 0.1 to 1 s.
max_equilibration_time
class-attribute
instance-attribute
max_equilibration_time: float = 5.0
Max equilibration time in s.
The EIS measurement requires a stationary state.
This means that before the actual measurement starts, the sine wave is
applied during max_equilibration_time only to reach the stationary state.
The maximum number of equilibration sine waves is however 5.
The minimum number of equilibration sines is set to 1, but for very
low frequencies, this time is limited by max_equilibration_time.
The maximum time to wait for stationary state is determined by the value of this parameter. A reasonable value might be 5 seconds. In this case this parameter is only relevant when the lowest frequency is less than 1/5 s so 0.2 Hz.
from_stage_type
classmethod
from_stage_type(id: str) -> BaseStage
Create new instance of appropriate stage from its type.
Source code in src/pypalmsens/_methods/mixed_mode.py
30 31 32 33 34 | |