sunpeek.core_methods.dcam_lite_collective.main.DCAMYieldStrategy_PerInterval#
- class sunpeek.core_methods.dcam_lite_collective.main.DCAMYieldStrategy_PerInterval(array, reference_conditions_type, use_wind, settings, **kwargs)#
Bases:
DCAMYieldStrategyStrategy variant: compute reference conditions independently for each interval.
Methods
__init__(array, reference_conditions_type, ...)apply_cut_time_init_error(interval, ...)Trim the beginning of a simulated interval to remove initialization effects.
calc_outputs(interval, te_out_simulated, data)Compute per-interval outputs.
Compute reference conditions used to convert collector parameters.
check_output(output)Additional checks to be performed on output of a strategy.
execute()Try to calculate strategy, sanitize check output dict and return if ok.
from_reference_conditions(array, ...)get_feedback(check_mode)run_forwardsim_interval(data, p2n, array)Run the forward simulation for one D-CAM operating interval.
- apply_cut_time_init_error(interval, te_out_simulated)#
Trim the beginning of a simulated interval to remove initialization effects.
If
settings.cut_time_init_erroris unset, zero, or negative, the interval and simulated outlet-temperature series are returned unchanged. Otherwise, the interval start is shifted forward by that duration andte_out_simulatedis sliced to the remaining timestamps.- Parameters:
- Returns:
The effective interval after trimming and the corresponding simulated outlet-temperature series.
- Return type:
tuple[tuple[dt.datetime,dt.datetime],pd.Series]- Raises:
ValueError – If the configured cut duration removes the complete simulated interval.
- calc_outputs(interval, te_out_simulated, data)#
Compute per-interval outputs.
- calc_reference_conditions(data)#
Compute reference conditions used to convert collector parameters.
- check_output(output)#
Additional checks to be performed on output of a strategy.
- execute()#
Try to calculate strategy, sanitize check output dict and return if ok.
- Returns:
- Raises:
- classmethod from_reference_conditions(array, reference_conditions_type, use_wind, settings, **kwargs)#
- Return type:
Factory method returning the concrete strategy implementation. Raises
ValueError for unsupported ReferenceConditionsType.
- run_forwardsim_interval(data, p2n, array)#
Run the forward simulation for one D-CAM operating interval.
In normal mode, this method builds
DCAMSettingsfrom the strategy settings and delegates torun_forward_simulation. The returned dictionary contains the simulated outlet temperature and additional solver output.In mock mode, no solver is executed. The method returns a dictionary with the same keys as the normal solver output.
T_f_outletcontains a simple mock outlet-temperature series based on measuredte_out; all other solver-output keys are present and set toNone.- Parameters:
data – Interval data returned by
get_dcam_data. Required solver inputs includete_in,te_out,te_op,te_amb,rd_bti,rd_dti,iam, andmf. Ifindexis missing, it is reconstructed fromarray.plant.time_indexand the current interval.p2n – Collector parameters converted to the D-CAM 2-N model format.
array – SunPeek array being simulated.
- Returns:
Solver-shaped result dictionary. In both normal and mock mode,
T_f_outletcontains the simulated outlet-temperature series. In normal mode,T_f,T_s,x_discrete, andinitial_statescontain the detailed solver outputs. In mock mode, those keys are set toNone.- Return type:
Dict[str,Any]- Raises:
RuntimeError – If neither
data["index"]nor the current interval is available.DCAMError – If required interval data such as
cp_meanare missing.ValueError – If
n_discretizationis configured as a list with more than one value.
- property specific_volume: Quantity#
Array specific volume required for 1N->2N conversion.
Prefer a dedicated array attribute
specific_volume. For compatibility with existing plant configurations and tests, fall back to deriving it fromfluidvol_total / area_grwhen available.