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',
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 thevoltagearraythreshold (positive, non-zero
int) – Max allowed index distance between crossing-points before a new crossing-island is formed. That is, ifthreshold=5then 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
intorfloat) –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_sizeis taken, wherearray_sizeis the size ofvoltageandfactor = 0.1forfit_type = "linear"and0.2for"exponential".min_points = numpy.infThe entire passed array is fitted.min_points >= 1Exact minimum number of points.0 < min_points < 0The 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 whichFitFunctionclass should be applied to the trace.linear
exponential
- Returns:
vf (
floatornumpy.nan) – The calculated floating potential (same units as thevoltagearray). Returnsnumpy.nanif the floating potential can not be determined.extras (
VFExtras) – Additional information from the fit:extras.vf_err(floatornumpy.nan)The uncertainty associated with the floating potential calculation (units same as
vf). Returnsnumpy.nanif 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
rsqproperty on the associated fit function (e.g. thersqproperty ofExponentialPlusOffset).extras.fitted_func(fit-function)The computed fit-function specified by
fit_type.extras.islands(List[slice])List of
sliceobjects representing the indices of the identified crossing-islands.extras.fitted_indices(slice)A
sliceobject representing the indices of thevoltageandcurrentarrays used for the fit.
Notes
The internal functionality works like:
The current array
currentis 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
thresholdkeyword.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.nanvalues.
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_pointsis satisfied.A fit is then performed using
scipy.stats.linregressforfit_type="linear"andscipy.optimize.curve_fitforfit_type="exponential".