Line losses with absolute approximation error#1470
Closed
Conversation
6 tasks
Contributor
Author
|
Superseded by #1495 |
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.
Closes #1320.
Changes proposed in this Pull Request
If line losses are enabled, changing the capacity maximum for lines
s_nom_max, affects the results of the optimization - even if the constraint is not binding (see #1320). The reason is that the tangents which approximate the quadratic loss depend ons_nom_max. More precisely: Currently the user specifies a numberNof tangents they want to use for the approximation, and then the interval[0, s_nom_max]is divided intoNsegments, each corresponding to one tangent. Ifs_nom_maxis changed, these intervals change, and so do the corresponding tangents. This PR suggests to specify an absolute tolerance for the approximation error instead and to use that to partition[0, s_nom_max]. In this case, ifs_nom_maxis changed, the number of tangents in the approximation changes, but the tangents that still exist are the same.Let$\epsilon$ be the absolute error tolerance, $r x^2$ be the loss parabola, and $2 r x_0 x - r x_0^2$ be its tangent at the point $x_0$ . Consider the points where the approximation error is exactly $\epsilon$ , that is $r x^2 - 2 r x_0 x + r x_0^2 = \epsilon$ , the roots of this polynomial are $x_0 \pm \sqrt{\epsilon/r}$ . We can conclude that the approximation error is smaller than $\epsilon$ in the interval $[x_0 - \sqrt{\epsilon/r}, x_0 + \sqrt{\epsilon/r}]$ . Thus, if we pick the tangents at $x0 = \dots, -4\sqrt{\epsilon/r}, -2\sqrt{\epsilon/r}, 0, 2\sqrt{\epsilon/r}, 4\sqrt{\epsilon/r}, \dots$ we can be sure that the absolute error of the approximation is smaller than $\epsilon$ .
From this we can compute the number of tangents we need for a conservative loss approximation with error at most$\epsilon$ by partitioning the interval $2\sqrt{\epsilon/r}$ . If $\epsilon$ is too small the number of tangents may get large. To avoid performance hits from that, I added a warning.
[-s_nom_max, s_nom_max]into segments of lengths_nom_maxis very large orThis PR is orthogonal to #1409. It does not primarily improve the quality of the approximation, but fixes the side-effects of changing
s_nom_max.Checklist
This is a draft of the proposed change, if your feedback is positive I will polish it up.
docs.docs/release-notes.mdof the upcoming release is included.