device_analysis¶
PV_Circuit_Model.device_analysis
¶
get_Voc(argument, interpolation_method=0)
¶
Compute open-circuit voltage (Voc) from an IV curve or CircuitGroup.
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argument
|
Union[CircuitGroup, ndarray]
|
CircuitGroup or IV curve. |
required |
interpolation_method
|
int
|
0 linear, 1 upper bound, 2 lower bound. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Open-circuit voltage. |
Example
from PV_Circuit_Model.device_analysis import get_Voc
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
get_Voc(cell)
get_Isc(argument, interpolation_method=0)
¶
Compute short-circuit current (Isc) from an IV curve or CircuitGroup.
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argument
|
Union[CircuitGroup, ndarray]
|
CircuitGroup or IV curve. |
required |
interpolation_method
|
int
|
0 linear, 1 upper bound, 2 lower bound. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Short-circuit current. |
Example
from PV_Circuit_Model.device_analysis import get_Isc
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
get_Isc(cell)
get_Jsc(argument)
¶
Compute short-circuit current density (Jsc).
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argument
|
CircuitGroup
|
CircuitGroup with IV data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Short-circuit current density. |
Example
from PV_Circuit_Model.device_analysis import get_Jsc
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
get_Jsc(cell)
get_Pmax(argument, return_op_point=False, refine_IV=True, interpolation_method=0)
¶
Compute maximum power from an IV curve or group.
Optionally refines IV around the operating point.
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argument
|
Union[CircuitGroup, ndarray]
|
CircuitGroup or IV curve. |
required |
return_op_point
|
bool
|
If True, return (Pmax, Vmp, Imp). |
False
|
refine_IV
|
bool
|
If True, refine IV around the peak. |
True
|
interpolation_method
|
int
|
0 linear, 1 upper bound, 2 lower bound. |
0
|
Returns:
| Type | Description |
|---|---|
Union[float, Tuple[float, float, float]]
|
Union[float, Tuple[float, float, float]]: Pmax or (Pmax, Vmp, Imp). |
Example
from PV_Circuit_Model.device_analysis import get_Pmax
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
get_Pmax(cell)
get_Eff(argument)
¶
Compute efficiency from maximum power and area.
Uses get_Pmax and scales by area when available.
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argument
|
CircuitGroup
|
CircuitGroup with IV data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Efficiency value. |
Example
from PV_Circuit_Model.device_analysis import get_Eff
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
get_Eff(cell)
get_FF(argument, interpolation_method=0)
¶
Compute fill factor from IV curve or group.
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argument
|
Union[CircuitGroup, ndarray]
|
CircuitGroup or IV curve. |
required |
interpolation_method
|
int
|
0 linear, 1 upper bound, 2 lower bound. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fill factor value. |
Example
from PV_Circuit_Model.device_analysis import get_FF
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
get_FF(cell)
Rs_extraction_two_light_IVs(IV_curves)
¶
Estimate series resistance from two light IV curves.
Uses the shift between full-sun and half-sun operating points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
IV_curves
|
Sequence[ndarray]
|
Two IV curves at different irradiance. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Estimated series resistance. |
Example
import numpy as np
from PV_Circuit_Model.device_analysis import Rs_extraction_two_light_IVs
IV1 = np.array([....])
IV2 = np.array([....])
Rs_extraction_two_light_IVs([IV1, IV2])
Rshunt_extraction(IV_curve, base_point=0)
¶
Estimate shunt resistance from the IV curve near a base point.
Performs a local linear fit around the specified voltage region.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
IV_curve
|
ndarray
|
IV curve array with shape (2, N). |
required |
base_point
|
float
|
Voltage around which to estimate slope. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Estimated shunt resistance. |
Example
import numpy as np
from PV_Circuit_Model.device_analysis import Rshunt_extraction
IV = np.array([....])
Rshunt_extraction(IV)
estimate_cell_J01_J02(Jsc, Voc, Pmax=None, FF=1.0, Rs=0.0, Rshunt=1000000.0, temperature=25, Sun=1.0, Si_intrinsic_limit=True, **kwargs)
¶
Estimate J01 and J02 for a cell that matches target IV metrics.
Iteratively adjusts diode saturation currents to match Voc and Pmax.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Jsc
|
float
|
Short-circuit current density. |
required |
Voc
|
float
|
Open-circuit voltage. |
required |
Pmax
|
Optional[float]
|
Target maximum power. |
None
|
FF
|
float
|
Target fill factor if Pmax is not provided. |
1.0
|
Rs
|
float
|
Series resistance. |
0.0
|
Rshunt
|
float
|
Shunt resistance. |
1000000.0
|
temperature
|
float
|
Temperature in Celsius. |
25
|
Sun
|
float
|
Irradiance multiplier. |
1.0
|
Si_intrinsic_limit
|
bool
|
If True, include intrinsic Si diode. |
True
|
**kwargs
|
Any
|
Extra parameters for intrinsic diode. |
{}
|
Returns:
| Type | Description |
|---|---|
Tuple[float, float]
|
Tuple[float, float]: Estimated (J01, J02) values. |
Example
from PV_Circuit_Model.device_analysis import estimate_cell_J01_J02
estimate_cell_J01_J02(Jsc=0.04, Voc=0.7, FF=0.8)
plot(self, fourth_quadrant=True, show_IV_parameters=True, title='I-V Curve', show_solver_summary=False)
¶
Plot the IV curve and optionally annotate key parameters.
Produces a matplotlib figure with current and power axes when requested.
Warning
This function is monkey-patched onto CircuitComponent at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
self
|
CircuitComponent
|
Component with IV data. |
required |
fourth_quadrant
|
bool
|
If True, plot in power-generating quadrant. |
True
|
show_IV_parameters
|
bool
|
If True, annotate IV metrics. |
True
|
title
|
str
|
Figure window title. |
'I-V Curve'
|
show_solver_summary
|
bool
|
If True, open solver summary window. |
False
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Example
from PV_Circuit_Model.device_analysis import plot
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
plot(cell)
show(self)
¶
Show the IV figure in notebook or GUI environments.
In notebooks, the figure is non-blocking; otherwise it blocks until closed.
Warning
This function is monkey-patched onto CircuitComponent at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
self
|
CircuitComponent
|
Component with plotted IV data. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Example
from PV_Circuit_Model.device_analysis import show
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
cell.plot()
cell.show()
quick_solar_cell(Jsc=0.042, Voc=0.735, FF=0.82, Rs=0.3333, Rshunt=1000000.0, wafer_format='M10', half_cut=True, **kwargs)
¶
Create a quick solar cell model from target IV parameters.
Uses the estimator to derive J01/J02 and constructs a cell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Jsc
|
float
|
Target short-circuit current density. |
0.042
|
Voc
|
float
|
Target open-circuit voltage. |
0.735
|
FF
|
float
|
Target fill factor. |
0.82
|
Rs
|
float
|
Series resistance. |
0.3333
|
Rshunt
|
float
|
Shunt resistance. |
1000000.0
|
wafer_format
|
str
|
Wafer format key for geometry. |
'M10'
|
half_cut
|
bool
|
If True, use half-cut geometry. |
True
|
**kwargs
|
Any
|
Extra parameters forwarded to |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Cell |
Cell
|
Constructed cell instance. |
Example
from PV_Circuit_Model.device_analysis import quick_solar_cell
cell = quick_solar_cell(Jsc = 0.04, Voc = 0.7, FF = 0.81)
Cell_(*args, **kwargs)
¶
This is a shorthand for quick_solar_cell.
quick_module(Isc=None, Voc=None, FF=None, Pmax=None, wafer_format='M10', num_strings=3, num_cells_per_halfstring=24, special_conditions=None, half_cut=False, butterfly=False, **kwargs)
¶
Create a module from target IV parameters.
Builds cells and tunes parameters to match target Pmax or FF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Isc
|
Optional[float]
|
Target short-circuit current. |
None
|
Voc
|
Optional[float]
|
Target open-circuit voltage. |
None
|
FF
|
Optional[float]
|
Target fill factor. |
None
|
Pmax
|
Optional[float]
|
Target maximum power. |
None
|
wafer_format
|
str
|
Wafer format key for geometry. |
'M10'
|
num_strings
|
int
|
Number of parallel strings. |
3
|
num_cells_per_halfstring
|
int
|
Cells per half-string. |
24
|
special_conditions
|
Optional[Dict[str, Any]]
|
Special options (e.g., "force_n1"). |
None
|
half_cut
|
bool
|
If True, use half-cut geometry. |
False
|
butterfly
|
bool
|
If True, use butterfly layout. |
False
|
**kwargs
|
Any
|
Extra parameters forwarded to cell creation. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Module |
Module
|
Constructed module instance. |
Example
from PV_Circuit_Model.device_analysis import quick_module
module = quick_module(Isc = 13, Voc = 72*0.7, FF = 0.79)
Module_(*args, **kwargs)
¶
This is a shorthand for quick_solar_cell.
quick_butterfly_module(Isc=None, Voc=None, FF=None, Pmax=None, wafer_format='M10', num_strings=3, num_cells_per_halfstring=24, special_conditions=None, half_cut=True, **kwargs)
¶
Create a butterfly module from target IV parameters.
This is a convenience wrapper around quick_module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Isc
|
Optional[float]
|
Target short-circuit current. |
None
|
Voc
|
Optional[float]
|
Target open-circuit voltage. |
None
|
FF
|
Optional[float]
|
Target fill factor. |
None
|
Pmax
|
Optional[float]
|
Target maximum power. |
None
|
wafer_format
|
str
|
Wafer format key for geometry. |
'M10'
|
num_strings
|
int
|
Number of parallel strings. |
3
|
num_cells_per_halfstring
|
int
|
Cells per half-string. |
24
|
special_conditions
|
Optional[Dict[str, Any]]
|
Special options. |
None
|
half_cut
|
bool
|
If True, use half-cut geometry. |
True
|
**kwargs
|
Any
|
Extra parameters forwarded to cell creation. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Module |
Module
|
Constructed module instance. |
Example
from PV_Circuit_Model.device_analysis import quick_butterfly_module
module = quick_butterfly_module(Isc = 13, Voc = 72*0.7, FF = 0.79)
module.connection
quick_tandem_cell(Jscs=(0.019, 0.02), Vocs=(0.71, 1.2), FFs=(0.8, 0.78), Rss=(0.3333, 0.5), Rshunts=(1000000.0, 50000.0), thicknesses=(0.016, 1e-06), wafer_format='M10', half_cut=True)
¶
Create a quick tandem (multi-junction) cell model.
Builds subcells from target metrics and combines them in series.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Jscs
|
Sequence[float]
|
Target short-circuit current densities. |
(0.019, 0.02)
|
Vocs
|
Sequence[float]
|
Target open-circuit voltages. |
(0.71, 1.2)
|
FFs
|
Sequence[float]
|
Target fill factors. |
(0.8, 0.78)
|
Rss
|
Sequence[float]
|
Series resistances per subcell. |
(0.3333, 0.5)
|
Rshunts
|
Sequence[float]
|
Shunt resistances per subcell. |
(1000000.0, 50000.0)
|
thicknesses
|
Sequence[float]
|
Subcell thicknesses. |
(0.016, 1e-06)
|
wafer_format
|
str
|
Wafer format key for geometry. |
'M10'
|
half_cut
|
bool
|
If True, use half-cut geometry. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
MultiJunctionCell |
MultiJunctionCell
|
Constructed multi-junction cell. |
Example
from PV_Circuit_Model.device_analysis import quick_tandem_cell
cell = quick_tandem_cell()
solver_summary(self, display_or_latex=0)
¶
Generate a solver summary for a circuit group.
Reports IV metrics, solver timings, and environment settings.
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
self
|
CircuitGroup
|
CircuitGroup with solver data. |
required |
display_or_latex
|
int
|
0 for display, 1 for LaTeX units. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Formatted solver summary text. |
Example
from PV_Circuit_Model.device_analysis import solver_summary
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
cell.build_IV()
print(cell.solver_summary())
save_solver_summary(self, filepath)
¶
Save solver summary text to a file.
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
self
|
CircuitGroup
|
CircuitGroup with solver data. |
required |
filepath
|
str
|
Output file path. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Example
from PV_Circuit_Model.device_analysis import save_solver_summary
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
cell.build_IV()
cell.save_solver_summary("summary.txt")
save_IV_curve(argument, filepath)
¶
Save an IV curve to a tab-delimited text file.
Warning
This function is monkey-patched onto CircuitGroup at import time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argument
|
Union[CircuitComponent, ndarray]
|
Component or IV array. |
required |
filepath
|
str
|
Output file path. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Example
from PV_Circuit_Model.device_analysis import save_IV_curve
from PV_Circuit_Model.device import make_solar_cell
cell = make_solar_cell()
cell.build_IV()
cell.save_IV_curve("iv.txt")