System level control framework#751
Draft
elenya-grant wants to merge 134 commits into
Draft
Conversation
…_control in storage baseclass setup()
…ontrol_classifiers models
Draft implementation of separate curtailment model
…stem_level_control
… slc/feedstock_connection
…grate into system_level_control
… demand following examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
System level control framework
We are still working on filling out the PR body!
This work was also done by @kbrunik and @johnjasa :)
Introducing the initial framework for system level control. This PR introduces 3 system level controllers, which are simple controllers. The goal of this PR is to introduce the framework for system level control - which will be further developed in future PRs that address the issues listed in Section 4.
The three system level controllers are:
DemandFollowingControlCostMinimizationControlProfitMaximizationControlMany of the file changes in this PR are related to adding control classifiers for each technology performance model.
PR's that were pre-requisites to this are:
The information that the system level controller is input for each technology is:
Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
Type of Reviewer Feedback Requested (on Draft PR)
Structural feedback:
Implementation feedback:
Other feedback:
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.md"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
XYZshould be replaced with the actual number.Section 4: Related Issues
Issues related to this PR
Issues for planned follow-on work
Section 5: Impacted Areas of the Software
Section 5.1: New Files
h2integrate/control/control_strategies/system_level/solver_options.pySLCSolverOptionsConfig: configuration class for the non-linear solver options to specify for the system level controller. This is used to avoid usage of hard-coded defaults inH2IntegrateModel.h2integrate/control/control_strategies/system_level/system_level_control_base.pySystemLevelControlBase: baseclass for system level controllers. Includes methods to setup inputs and outputs and methods that may be useful for the controllers. Thesetup()method ensures that all commodity streams are defined with consistent units (aka - all hydrogen commodity streams are defined in kg/h and all electricity commodity streams are defined in kW, etc)h2integrate/control/control_strategies/system_level/cost_minimization_control.pyCostMinimizationControl:h2integrate/control/control_strategies/system_level/demand_following_control.pyDemandFollowingControl:h2integrate/control/control_strategies/system_level/profit_maximization_control.pyProfitMaximizationControl:ProfitMaximizationControlConfigSection 5.2: Modified Files (of importance)
h2integrate/core/h2integrate_model.py__init__(): Added attributeslcwhich is used to decide whether to call_classify_slc_technologies()andadd_system_level_controller._classify_slc_technologies(): new method that creates theslc_configdictionary used in the system level controller base class and is an input toadd_system_level_controller()add_system_level_controller(): new method that creates the system level control model and connects the corresponding inputs and outputs between technologies and the system level controllercreate_technology_models(): updated to populate the attributeself.tech_control_classifierswhich is a dictionary with keys as the technology names and values of the corresponding technology control classifier.h2integrate/core/supported_models.py: addedstrategy_mapdictionary which is the equivalent ofsupported_modelsbut specifically for system level controllersh2integrate/core/model_baseclasses.pyPerformanceModelBaseClassapply_curtailment(): new method that applies curtailment to the output of any technology that is classified as "flexible". This logic only happens if "system_level_control" is found as a top-level key in the plant configuration file.setup(): checks if control classifier is flexible and if so, adds input off"{self.commodity}_set_point"and output off"uncurtailed_{self.commodity}_out"CostModelBaseClasssetup(): added output of "marginal_cost".h2integrate/finances/profast_lco.pyProFastLCO.compute(): updated to not run profast if the capacity factor is zero and ifsystem_level_controlis found in the plant config. Warns the user that its setting the LCO output to a large number but that it was not actually calculated if the the capacity factor is zero andsystem_level_controlis found in the plant configSection 6: Additional Supporting Information
Section 7: Test Results, if applicable
Section 8 (Optional): New Model Checklist
docs/developer_guide/coding_guidelines.mdattrsclass to define theConfigto load in attributes for the modelBaseConfigorCostModelBaseConfiginitialize()method,setup()method,compute()methodCostModelBaseClasssupported_models.pycreate_financial_modelinh2integrate_model.pytest_all_examples.pydocs/user_guide/model_overview.mddocs/section<model_name>.mdis added to the_toc.ymlgenerate_class_hierarchy.pyto update the class hierarchy diagram indocs/developer_guide/class_structure.md