idaholab / HERON

Holistic Energy Resource Optimization Network (HERON) is a modeling toolset and plugin for RAVEN to accelerate stochastic technoeconomic assessment of the economic viability of various grid-energy system configurations, especially with application to electrical grids and integrated energy systems (IES).
Apache License 2.0
24 stars 38 forks source link

[Task] Allow Storage initial condition and periodic boundaries together #369

Open sobinc1 opened 3 months ago

sobinc1 commented 3 months ago

Defect Description

Describe the defect

What did you expect to see happen?

The system should stick to the periodic condition for the defined initial storage level as configured in the system settings.

What did you see instead?

During a debug run, an arbitrary initial storage level was detected, which does not comply with the predefined periodic condition constraints.

Do you have a suggested fix for the development team?
 ----> I found adding this script works for it under" if comp.get_interaction().apply_periodic_level:" pyomomodel handler
  initial = self.initial_storage[comp]
  rule = lambda mod, t: prl.periodic_level_rule(comp, level_name, initial, r, mod, t)
  setattr(self.model, periodic_rule_name, pyo.Constraint(self.model.T, rule=rule))

Describe how to Reproduce Steps to reproduce the behavior:

Screenshots and Input Files Please attach the input file(s) that generate this error. The simpler the input, the faster we can find the issue.

Platform (please complete the following information):


For Change Control Board: Issue Review

This review should occur before any development is performed as a response to this issue.


For Change Control Board: Issue Closure

This review should occur when the issue is imminently going to be closed.

PaulTalbot-INL commented 3 months ago

Hi, @sobinc1! This change was the result of work done in #346 , in which we recognized that both allowing periodic boundary conditions and setting the initial level was over-constraining the problem. Because the boundary conditions are an approximation, allowing the initial (and hence final) level of the storage units to fluctuate gives the greatest chance to observe how the storage units could ideally be used within the optimization periods. I believe this is a better modeling representation for most HERON analysis. Analysts can either choose to set an initial level and let the end point vary, or let the start and end point match but not specify the initial level.

If being able to specify both periodic level as well as set the initial stored level is desirable, we can look into the feature request that you suggest here. Let me know what you think.