Skip to content

Conversation

@obrix
Copy link
Member

@obrix obrix commented Jan 25, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Add a notebook to illustrate operator strategy and action API in pypowsybl. The example is based on powsybl metrix 6 node network tutorial.

Does this PR already have an issue describing the problem?

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

"metadata": {
"raw_mimetype": "text/markdown"
},
"source": [
Copy link
Member

@annetill annetill Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This notebook illustrates how to run a security analysis with remedial actions. For a contingency, an operator strategy groups a list of actions and a condition to apply them. This small tutorial is based on a 6 nodes network, called Metrix, that is easily understandable. We are going to simulate contingencies and various operator strategies to show the available features. Network elements can be monitored in pre-contingency state, after a contingency and after each operator strategy.

},
"source": [
"A single contingency on line S_SO_1 is added to the security analysis. The goal it to watch the flow grow on line S_SO_2 and test various strategy to lower it."
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We simulate a contingency on line S_SO_1. When loosing this line, flows are redirected and line S_SO_2 is overloaded. We are going to test various operator strategies to remove the limit violation.

"raw_mimetype": "text/markdown"
},
"source": [
"A first of topological remedial action is programmed, the opening of switches SS1_SS1_DJ_OMN and SOO1_SOO1_DJ_OMN. Three operator strategy will be tested : Opening only the fist switch, opening only the second switch and opening both."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to add all the actions involved in the strategies you want to test. Here, we want to see the effect of opening switches SS1_SS1_DJ_OMN or/and SOO1_SOO1_DJ_OMN: opening only the first one, only the second one or both.

"metadata": {},
"outputs": [],
"source": [
"sa.add_operator_strategy('StrategyOpenSS1_SS1', 'S_SO_1_contingency', ['Switch_SS1_SS1_DJ_OMN_OPEN']) "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you add the operator strategy without any explanation but you are missing to explain the condition of application. True condition? Because here it could be a any violation condition.

"raw_mimetype": "text/markdown"
},
"source": [
"An additional strategy is modify some generators target P to lower the flow on line S_SO_2. For this we try to redispatch P between SO_G2 and SE_G."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An other strategy could be to modify the active power target of some generators, in a way the two modifications compensate (also called re-dispatching). Decreasing active power target of generator SO_G2 and increasing active power of SO_G2 (closer to loads) could be efficient.

"id": "e79b458f",
"metadata": {},
"source": [
"## Observe the flow on each step of the analysis"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you first show the violation after contingency and after operator strategies. And after that, you can print the branch results.

"id": "22a1ea96",
"metadata": {},
"source": [
"# Pypowsybl action and operator strategy API demo "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the title of your PR: Operator strategy notebook

obrix and others added 4 commits February 2, 2024 16:01
Signed-off-by: Bertrand Rix <[email protected]>
Signed-off-by: Bertrand Rix <[email protected]>
Signed-off-by: Coline PILOQUET <[email protected]>
Signed-off-by: Coline PILOQUET <[email protected]>
Signed-off-by: Anne Tilloy <[email protected]>
@annetill annetill merged commit 05a5922 into main Feb 5, 2024
@annetill annetill deleted the operator_strategies_notebook branch February 5, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants