Data Classes Module#
Data classes for analyzing wireless power transfer systems.
- class wpt_tools.data_classes.ValR2(value: float | None, r2: float | None)#
Bases:
objectPair of value and R2 score.
- Parameters:
value (float) – The value.
r2 (float) – The R2 score.
- __init__(value: float | None, r2: float | None)#
Initialize the class.
- value: float | None#
- r2: float | None#
- class wpt_tools.data_classes.EfficiencyResults#
Bases:
objectResults of efficiency solver.
- __init__()#
Initialize the results.
- f_plot: list[float]#
- r_opt: list[float]#
- x_opt: list[float]#
- eff_opt: list[float]#
- max_f_plot: float#
- max_eff_opt: float#
- max_r_opt: float#
- max_x_opt: float#
- print_table() None#
Print a summary table of peak efficiency and optimal load.
- validate() None#
Validate required fields for printing/plotting.
- class wpt_tools.data_classes.LCRFittingResults#
Bases:
objectResults of LCR fitting.
- Parameters:
ls1 (float) – The inductance of the first series LCR.
cs1 (float) – The capacitance of the first series LCR.
rs1 (float) – The resistance of the first series LCR.
ls2 (float) – The inductance of the second series LCR.
cs2 (float) – The capacitance of the second series LCR.
rs2 (float) – The resistance of the second series LCR.
lm (float) – The inductance of the mutual coupling.
km (float) – The mutual coupling coefficient.
- __init__()#
Initialize the results.
- print_table() None#
Print port-1, port-2 (if present), and mutual tables separately.
- validate() None#
Validate required fitted values exist before printing/plotting.
- class wpt_tools.data_classes.OptimalLoadGridResults(rez_list: ndarray, imz_list: ndarray, eff_grid: ndarray, Pin: ndarray, Pout: ndarray, target_f: float | None)#
Bases:
objectResults for optimal load grid sweep (efficiency, Pin, Pout).
- __init__(rez_list: ndarray, imz_list: ndarray, eff_grid: ndarray, Pin: ndarray, Pout: ndarray, target_f: float | None)#
Initialize the optimal load grid results.
- rez_list: ndarray#
- imz_list: ndarray#
- eff_grid: ndarray#
- Pin: ndarray#
- Pout: ndarray#
- target_f: float | None#
- print_table() None#
Print sweep metadata (dimensions and target freq).
- validate() None#
Validate required arrays for plotting/printing.
- class wpt_tools.data_classes.RXCFilterResults(cp: float, cs: float, rload: float, max_r_opt: float, max_x_opt: float, max_f_plot: float, lrx: float)#
Bases:
objectResults for receiver RXC filter calculation at optimal point.
- __init__(cp: float, cs: float, rload: float, max_r_opt: float, max_x_opt: float, max_f_plot: float, lrx: float) None#
- cp: float#
- cs: float#
- rload: float#
- max_r_opt: float#
- max_x_opt: float#
- max_f_plot: float#
- lrx: float#
- print_table() None#
Print RXC filter summary values.
- validate() None#
Validate RXC filter fields before printing/plotting.
- class wpt_tools.data_classes.RichNetwork(nw: Network, f_narrow_index_start: int | None = None, f_narrow_index_stop: int | None = None, target_f_index: int | None = None, sweeppoint: int | None = None, range_f: float | None = None, target_f: float | None = None)#
Bases:
objectA dataclass for analyzing wireless power transfer systems.
- Parameters:
nw (rf.Network) – The network to analyze.
f_narrow_index_start (Optional[int]) – The start index of the narrowband range.
f_narrow_index_stop (Optional[int]) – The stop index of the narrowband range.
target_f_index (Optional[int]) – The index of the target frequency.
sweeppoint (Optional[int]) – The number of points in the sweep.
range_f (Optional[float]) – The range of the target frequency.
target_f (float) – The target frequency.
- __init__(nw: Network, f_narrow_index_start: int | None = None, f_narrow_index_stop: int | None = None, target_f_index: int | None = None, sweeppoint: int | None = None, range_f: float | None = None, target_f: float | None = None) None#
- nw: Network#
- f_narrow_index_start: int | None = None#
- f_narrow_index_stop: int | None = None#
- target_f_index: int | None = None#
- sweeppoint: int | None = None#
- range_f: float | None = None#
- target_f: float | None = None#
- classmethod from_touchstone(source: str | Path | Network) RichNetwork#
Create a nw_with_config instance from a touchstone file or an rf.Network object.
- set_f_target_range(target_f: float, range_f: float) None#
Set the target frequency and range for the analysis.
- Parameters:
target_f (float) – The target frequency.
range_f (float) – The range of the target frequency.
- wpt_tools.data_classes.override_frange(rich_nw: RichNetwork, target_f: float | None, range_f: float | None) RichNetwork#
Override target frequency and range (or validate existing), and compute indices.
If both are provided, applies set_f_target_range.
Otherwise, validates existing values and computes missing indices.