find_floating_potential
- plasmapy.analysis.swept_langmuir.floating_potential.find_floating_potential(voltage: ndarray, current: ndarray, threshold: int = 1, min_points: float | None = None, fit_type: str = 'exponential') tuple[floating, VFExtras] [source]
Determine the floating potential (\(V_f\)) for a given current-voltage (IV) curve obtained from a swept Langmuir probe.
The floating potential is the probe bias where the collected current equals zero \(I = 0\). (For additional details see the Notes section below.)
Aliases:
find_vf_()
- Parameters:
voltage (
numpy.ndarray
) – 1-D numpy array of monotonically ascending probe biases (should be in volts)current (
numpy.ndarray
) – 1-D numpy array of probe current (should be in amperes) corresponding to thevoltage
arraythreshold (positive, non-zero
int
) – Max allowed index distance between crossing-points before a new crossing-island is formed. That is, ifthreshold=5
then consecutive crossing-points are considered to be in the same crossing-island if they are within 5 index steps of each other. (Default: 1)min_points (positive
int
orfloat
) –Minimum number of data points required for the fitting to be applied to. See Notes section below for additional details. The following list specifies the optional values:
min_points = None
(Default) The largest of 5 andfactor * array_size
is taken, wherearray_size
is the size ofvoltage
andfactor = 0.1
forfit_type = "linear"
and0.2
for"exponential"
.min_points = numpy.inf
The entire passed array is fitted.min_points >= 1
Exact minimum number of points.0 < min_points < 0
The minimum number of points is taken asmin_points * array_size
.
fit_type (str) –
The type of curve to be fitted to the Langmuir trace,
"linear"
or"exponential"
(Default). This selects whichFitFunction
class should be applied to the trace.linear
exponential
- Returns:
vf (
float
ornumpy.nan
) – The calculated floating potential (same units as thevoltage
array). Returnsnumpy.nan
if the floating potential can not be determined.extras (
VFExtras
) – Additional information from the fit:extras.vf_err
(float
ornumpy.nan
)The uncertainty associated with the floating potential calculation (units same as
vf
). Returnsnumpy.nan
if the floating potential can not be determined. Like \(V_f\):, the calculation depends on the applied fit function. Theroot_solve()
method also describes how this is calculated.extras.rsq
(float
)The coefficient of determination (r-squared) value of the fit. See the documentation of the
rsq
property on the associated fit function (e.g. thersq
property ofExponentialPlusOffset
).extras.fitted_func
(fit-function)The computed fit-function specified by
fit_type
.extras.islands
(List[slice]
)List of
slice
objects representing the indices of the identified crossing-islands.extras.fitted_indices
(slice
)A
slice
object representing the indices of thevoltage
andcurrent
arrays used for the fit.
Notes
The internal functionality works like:
The current array
current
is scanned for all points equal to zero and point pairs that straddle \(I = 0\). This forms an array of “crossing-points.”The crossing-points are then grouped into “crossing-islands” in based on the
threshold
keyword.A new island is formed when a successive crossing-point is more (index) steps away from the previous crossing-point than allowed by
threshold
.If multiple crossing-islands are identified, then the span from the first point in the first island to the last point in the last island is compared to
min_points
. If the span is less than or equal tomin_points
, then that span is taken as one larger crossing-island for the fit; otherwise, the function is incapable of identifying \(V_f\) and will returnnumpy.nan
values.
To calculate the floating potential…
If the crossing-island contains fewer points than
min_points
, then each side of the crossing-island is equally padded with the nearest neighbor points untilmin_points
is satisfied.A fit is then performed using
scipy.stats.linregress
forfit_type="linear"
andscipy.optimize.curve_fit
forfit_type="exponential"
.