Skip to content

SLC: Add check for controllers that only work with a specific architecture #804

Description

@elenya-grant

I'd imagine that future system level controllers will be made for specific system designs. For example, the PLM control strategies are pretty specific to grid/battery architectures. Any controller that is made for a specific system architecture should have a check in the setup() method to ensure that it's only being used in that case. In the case for a controller is specific to grid/battery design, this controller should check two things:

  1. The number and types of technologies. Ex: grid/battery system means 1 "dispatchable" tech and 1 "storage" tech. Check that the input technologies have 1 dispatchable and 1 storage and nothing else
  2. The connection flow of the technology type. Ex: Check that the dispatchable tech (grid) is upstream and connected to the storage tech (battery)

The check for 1 is pretty simple, it could be implemented similar to this:

allowable_tech_classifications = {"dispatchable": 1, "storage": 1, "flexible": 0, "fixed": 0}

for classifier, allowable_number in allowable_tech_classifications.items():
   if allowable_number is None:
      continue
   n_techs = getattr(self, f"{classifier}_techs") 
   if n_techs != allowable_number:
      raise ValueError("fCannot have {n_techs} {classifier} techs for this controller. Must have {allowable_number} {classifier} techs")

My proposed solution for step 2 is to have the required system architecture defined as a Directional Graph (from network). Each node is named as the type of classifier.

required_architecture = nx.DiGraph()
required_architecture.add_edge("dispatchable-0", "storage-0")
# etc

then remake the technology graph input with a similar naming convention
input_architecture = nx.DiGraph()


classifier_name_mapper = {}
for ii,edge in enumerate(slc_topology["technology_graph"].edges):
   if (source_name:=classifier_name_mapper.get(edge[0],None) is None:
      source_name = f"{slc_topology['tech_control_classifiers'].get(edge[0], 'other')-{ii}"
      classifier_name_mapper[edge[0]] = source_name
   if (dest_name:=classifier_name_mapper.get(edge[1],None) is None:
      dest_name = f"{slc_topology['tech_control_classifiers'].get(edge[1], 'other')-{ii}"
      classifier_name_mapper[edge[1]] = dest_name
   
   input_architecture.add_edge(source_name, dest_name)

Then compare the required_architecture and input_architecture in whatever way is necessary to ensure that the controller is capable of handling that input architecture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions