Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Automatic tap changer in step-up transformer support #662

Open
1 of 3 tasks
Jerry-Jinfeng-Guo opened this issue Jul 4, 2024 · 2 comments · May be fixed by #826
Open
1 of 3 tasks

[FEATURE] Automatic tap changer in step-up transformer support #662

Jerry-Jinfeng-Guo opened this issue Jul 4, 2024 · 2 comments · May be fixed by #826
Labels
feature New feature or request

Comments

@Jerry-Jinfeng-Guo
Copy link
Contributor

Jerry-Jinfeng-Guo commented Jul 4, 2024

What need to happen:

  • Figure out the meeth
  • Control side at the node with higher rated voltage
  • Tap side and the control side at the same side
@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo added the feature New feature or request label Jul 4, 2024
@Jerry-Jinfeng-Guo
Copy link
Contributor Author

Jerry-Jinfeng-Guo commented Aug 15, 2024

Most changes will happen in power_grid_model_c/power_grid_model/include/power_grid_model/optimizer/tap_position_optimizer.hpp

What need to happen:

to

add_to_edge(state, edges, edge_props, from_node, to_node, {unregulated_idx, 0});
add_to_edge(state, edges, edge_props, to_node, from_node, {unregulated_idx, 0});
  • logic determining direction of transformer tap/control sides needs update:
  • after assigning ranks of all regulated transformers, one round of check:
    • two winding transformers: for every enabled such transformer, rank at the control side (node connected to it) should be 1 greater than the other side, throw exception if not the case.
    • three winding transformers:
      • control side == tap side: rank at the control side (node connected to it) should be 1 greater than any one of the two secondary sides, throw exception if not the case.
      • control side != tap side: rank at the control side (node connected to it) should be 1 greater than the secondary side with tap, throw exception if not the case.
  • Adjust control logic
    • auto const cmp = node_state <=> param;
      auto new_tap_pos = [&transformer, &cmp] {
      if (cmp > 0) { // NOLINT(modernize-use-nullptr)
      return one_step_control_voltage_down(transformer);
      }
      if (cmp < 0) { // NOLINT(modernize-use-nullptr)
      return one_step_control_voltage_up(transformer);
      }
      return transformer.tap_pos();
      }();
      linear search would have to include logic to go the opposite way if control side == tap side
    • void propose_new_pos(bool strategy_max, bool above_range) {
      bool const is_down = above_range == tap_reverse_;
      if (last_check_) {
      current_ = is_down ? lower_bound_ : upper_bound_;
      inevitable_run_ = true;
      } else {
      last_down_ = is_down;
      adjust(strategy_max);
      }
      }
      IntS repropose_tap(bool strategy_max, bool previous_down, bool& tap_changed) {
      // __prefer_higher__ indicates a preference towards higher voltage
      // that is a result of both the strategy as well as whether the current
      // transformer has a reversed tap_max and tap_min
      bool const prefer_higher = strategy_max != tap_reverse_;
      auto const tap_pos = search(prefer_higher);
      auto const tap_diff = tap_pos - get_current_tap();
      if (tap_diff == 0) {
      if (!inevitable_run_) {
      inevitable_run_ = true;
      tap_changed = true;
      } else {
      tap_changed = false;
      }
      return tap_pos;
      }
      if ((tap_diff == 1 && previous_down) || (tap_diff == -1 && !previous_down)) {
      last_check_ = true;
      }
      tap_changed = true;
      current_ = tap_pos;
      return tap_pos;
      }
      binary search would have to add new state control_tap_same_side in the binary logic

@mgovers
Copy link
Member

mgovers commented Aug 16, 2024

line numbers can change. can you add permalinks? (you can create them using the GitHub viewer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Q4 2024
Development

Successfully merging a pull request may close this issue.

2 participants