ubermagutil.hysteresis_values#
- ubermagutil.hysteresis_values(vmin, vmax, step)#
Generate hysteresis values.
Given
vmin
,vmax
, andstep
, hysteresis loop values are generated andlist
is returned. The first and the last values in the result arevmax
.If
vmax - vmin
range cannot be divided into integer number of steps,ValueError
is raised.- Parameters:
vmin (numbers.Real) – Minimum value
vmax (numbers.Real) – Maximum value
step (numbers.Real) – Step value
- Returns:
Hysteresis values.
- Return type:
list
- Raises:
ValueError – If
vmax - vmin
range cannot be divided into integer number of steps.
Examples
Generate hysteresis values.
>>> import ubermagutil as uu ... >>> uu.hysteresis_values(-1, 1, 1) [1.0, 0.0, -1.0, 0.0, 1.0]