The Segmented Calculation allows for a multi stage solving procedure, reducing the complexity of each individual model. The segments can be overlapping and the start values are set to match the end values of the prior segment
Previous values
Flow has a new optional attribute .previous_flow_rate, (np.array).
These are currently not directly needed, as the FlowModel does not have such constrains respectively.
Meanwhile, its used to determine the previous values of the ON and OFF Variable.
The depending initial switch on(off depends on these
The initial charge state of Storage is also fixed to the new value for the next segment.
Results
While the analysis of the Results of the Segmented calculation are not optimal, big improvements were made in terms of stability and readability of the results.
3 modes are available
combined_arrays: Retrieve the combined array Results of all Segments as 'combined_arrays'. All result arrays are concatenated, taking care of removing the overlap. These results can be directly compared to other Calculation results. Unfortunately, Scalar values like the total of effects can not be combined in a deterministic way. Rather convert the time series effect results to a sum yourself.
combined_scalars: Retrieve the combined scalar Results of all Segments. All Scalar Values like the total of effects are combined and stored in a List. Take care that the total of multiple Segment is not equivalent to the total of the total timeSeries, as it includes the Overlap!
individual_results: Retrieve the individual results of each Segment
Furthermore, the passed start_values of each segment can be retrieved easily
Know Issues
No Checking for 'incompatible' / improper Models for SgementedModeling (Investment)
previous_values still not included in duration constraints for On
Others
This rework improved the SegmentedCalculation and made it more robust to changes, as the results structure is not handcrafted, but rather relies on a logical algorithm to combine the results of multiple calculations. This might also be handy elsewhere
Further, The segmented calculaitioin used multiple FullCalculations. This reduces the complexity of the class immensely
(Re-) Introducing SegmentedCalculation + Improvements
SegmentedCalcualtion
The Segmented Calculation allows for a multi stage solving procedure, reducing the complexity of each individual model. The segments can be overlapping and the start values are set to match the end values of the prior segment
Previous values
Results
While the analysis of the Results of the Segmented calculation are not optimal, big improvements were made in terms of stability and readability of the results. 3 modes are available
Furthermore, the passed start_values of each segment can be retrieved easily
Know Issues
Others
This rework improved the SegmentedCalculation and made it more robust to changes, as the results structure is not handcrafted, but rather relies on a logical algorithm to combine the results of multiple calculations. This might also be handy elsewhere
Further, The segmented calculaitioin used multiple FullCalculations. This reduces the complexity of the class immensely
Contributers
Felix Bumann
Closes #43 #44