energy_methods.physics#
Shape-constrained PV regression on POA and ambient temperature.
Nonnegative coefficients analytically enforce a nondecreasing, concave response to irradiance and a nonincreasing response to temperature on the declared domain. These are empirical response constraints, not identified module thermal physics.
Cite the main thesis for scientific context, Stark-Parker for the BVLS solver and SciPy for its implementation; the transformed PV basis is this repository’s parameterization. See energy_methods.references.
- class energy_methods.physics.PhysicsConfig(family: "Literal['thermal_quadratic', 'concave_spline']" = 'concave_spline', alpha: 'float' = 0.1, min_samples: 'int' = 24, poa_max_wm2: 'float' = 1300.0, temperature_min_c: 'float' = -20.0, temperature_max_c: 'float' = 60.0, operational_zero_poa_wm2: 'float' = 1.0, knots_wm2: 'tuple[float, ...]' = (200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0))[source]#
Bases:
object- Parameters:
family (Literal['thermal_quadratic', 'concave_spline'])
alpha (float)
min_samples (int)
poa_max_wm2 (float)
temperature_min_c (float)
temperature_max_c (float)
operational_zero_poa_wm2 (float)
knots_wm2 (tuple[float, ...])
- family: Literal['thermal_quadratic', 'concave_spline']#
- alpha: float#
- min_samples: int#
- poa_max_wm2: float#
- temperature_min_c: float#
- temperature_max_c: float#
- operational_zero_poa_wm2: float#
- knots_wm2: tuple[float, ...]#
- class energy_methods.physics.PhysicsModel(config: 'PhysicsConfig', coefficients: 'FloatArray', training_scale_mwh: 'float', training_rows: 'int', poa_support_wm2: 'tuple[float, float]', temperature_support_c: 'tuple[float, float]')[source]#
Bases:
object- Parameters:
config (PhysicsConfig)
coefficients (FloatArray)
training_scale_mwh (float)
training_rows (int)
poa_support_wm2 (tuple[float, float])
temperature_support_c (tuple[float, float])
- config: PhysicsConfig#
- coefficients: FloatArray#
- training_scale_mwh: float#
- training_rows: int#
- poa_support_wm2: tuple[float, float]#
- temperature_support_c: tuple[float, float]#
- to_dict()[source]#
Portable fitted state; no opaque estimator or executable serialization.
- Return type:
dict[str, object]
- predict(poa_wm2, temperature_c)[source]#
Return NaN outside the declared domain; startup cutoff is separate.
- Parameters:
poa_wm2 (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
temperature_c (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
- Return type:
FloatArray
- weather_support(poa_wm2, temperature_c)[source]#
Training-observed rectangular support, separate from physical domain.
- Parameters:
poa_wm2 (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
temperature_c (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
- Return type:
BoolArray
- energy_methods.physics.fit_physics_model(poa_wm2, temperature_c, actual_mwh, *, config=PhysicsConfig(family='concave_spline', alpha=0.1, min_samples=24, poa_max_wm2=1300.0, temperature_min_c=-20.0, temperature_max_c=60.0, operational_zero_poa_wm2=1.0, knots_wm2=(200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0)))[source]#
Fit only supplied accepted training rows using nonnegative least squares.
- Parameters:
poa_wm2 (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
temperature_c (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
actual_mwh (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
config (PhysicsConfig)
- Return type: