-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ANT-2300] Short-term storage: penalty for storage control, injection…
… and withdrawal flow gradient (#2491) Co-authored-by: Florian OMNES <[email protected]> Co-authored-by: Florian OMNES <[email protected]>
- Loading branch information
1 parent
88c711a
commit a7b0702
Showing
30 changed files
with
944 additions
and
86 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
48 changes: 48 additions & 0 deletions
48
src/solver/optimisation/constraints/ShortTermStorageCostVariation.cpp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright 2007-2024, RTE (https://www.rte-france.com) | ||
* See AUTHORS.txt | ||
* SPDX-License-Identifier: MPL-2.0 | ||
* This file is part of Antares-Simulator, | ||
* Adequacy and Performance assessment for interconnected energy networks. | ||
* | ||
* Antares_Simulator is free software: you can redistribute it and/or modify | ||
* it under the terms of the Mozilla Public Licence 2.0 as published by | ||
* the Mozilla Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Antares_Simulator is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Mozilla Public Licence 2.0 for more details. | ||
* | ||
* You should have received a copy of the Mozilla Public Licence 2.0 | ||
* along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>. | ||
*/ | ||
|
||
#include "antares/solver/optimisation/constraints/ShortTermStorageCostVariation.h" | ||
|
||
void ShortTermStorageCostVariation::addStorageConstraint(const std::string& constraintName, | ||
int pdt, | ||
int pays) | ||
{ | ||
ConstraintNamer namer(builder.data.NomDesContraintes); | ||
const int hourInTheYear = builder.data.weekInTheYear * 168 + pdt; | ||
namer.UpdateTimeStep(hourInTheYear); | ||
namer.UpdateArea(builder.data.NomsDesPays[pays]); | ||
|
||
builder.updateHourWithinWeek(pdt); | ||
for (const auto& storage: data.ShortTermStorage[pays]) | ||
{ | ||
if (IsConstraintEnabled(storage)) | ||
{ | ||
namer.ShortTermStorageCostVariation(constraintName, | ||
builder.data.nombreDeContraintes, | ||
storage.name); | ||
const auto index = storage.clusterGlobalIndex; | ||
|
||
TargetConstraintIndex(pdt, index) = builder.data.nombreDeContraintes; | ||
|
||
buildConstraint(index); | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/solver/optimisation/constraints/ShortTermStorageCostVariationInjectionBackward.cpp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
** Copyright 2007-2024, RTE (https://www.rte-france.com) | ||
** See AUTHORS.txt | ||
** SPDX-License-Identifier: MPL-2.0 | ||
** This file is part of Antares-Simulator, | ||
** Adequacy and Performance assessment for interconnected energy networks. | ||
** | ||
** Antares_Simulator is free software: you can redistribute it and/or modify | ||
** it under the terms of the Mozilla Public Licence 2.0 as published by | ||
** the Mozilla Foundation, either version 2 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** Antares_Simulator is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
** Mozilla Public Licence 2.0 for more details. | ||
** | ||
** You should have received a copy of the Mozilla Public Licence 2.0 | ||
** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>. | ||
*/ | ||
|
||
#include "antares/solver/optimisation/constraints/ShortTermStorageCostVariation.h" | ||
|
||
// CostVariationInjection[h] + Injection[h+1] - Injection[h] >= 0 | ||
void ShortTermStorageCostVariationInjectionBackward::buildConstraint(int index) | ||
{ | ||
builder.ShortTermCostVariationInjection(index, 1.0) | ||
.ShortTermStorageInjection(index, -1.0) | ||
.ShortTermStorageInjection(index, 1.0, 1, builder.data.NombreDePasDeTempsPourUneOptimisation) | ||
.greaterThan() | ||
.build(); | ||
} | ||
|
||
void ShortTermStorageCostVariationInjectionBackward::add(unsigned int pdt, unsigned int pays) | ||
{ | ||
addStorageConstraint("ShortTermStorageCostVariationInjectionBackward", pdt, pays); | ||
} | ||
|
||
int& ShortTermStorageCostVariationInjectionBackward:: | ||
ShortTermStorageCostVariationInjectionBackward::TargetConstraintIndex(int pdt, int index) | ||
{ | ||
return data.CorrespondanceCntNativesCntOptim[pdt] | ||
.ShortTermStorageCostVariationInjectionBackward[index]; | ||
} | ||
|
||
bool ShortTermStorageCostVariationInjectionBackward::IsConstraintEnabled( | ||
const ShortTermStorage::PROPERTIES& properties) | ||
{ | ||
return properties.penalizeVariationInjection; | ||
} |
50 changes: 50 additions & 0 deletions
50
src/solver/optimisation/constraints/ShortTermStorageCostVariationInjectionForward.cpp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
** Copyright 2007-2024, RTE (https://www.rte-france.com) | ||
** See AUTHORS.txt | ||
** SPDX-License-Identifier: MPL-2.0 | ||
** This file is part of Antares-Simulator, | ||
** Adequacy and Performance assessment for interconnected energy networks. | ||
** | ||
** Antares_Simulator is free software: you can redistribute it and/or modify | ||
** it under the terms of the Mozilla Public Licence 2.0 as published by | ||
** the Mozilla Foundation, either version 2 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** Antares_Simulator is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
** Mozilla Public Licence 2.0 for more details. | ||
** | ||
** You should have received a copy of the Mozilla Public Licence 2.0 | ||
** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>. | ||
*/ | ||
|
||
#include "antares/solver/optimisation/constraints/ShortTermStorageCostVariation.h" | ||
|
||
// CostVariationInjection[h] - Injection[h+1] + Injection[h] >= 0 | ||
void ShortTermStorageCostVariationInjectionForward::buildConstraint(int index) | ||
{ | ||
builder.ShortTermCostVariationInjection(index, 1.0) | ||
.ShortTermStorageInjection(index, 1.0) | ||
.ShortTermStorageInjection(index, -1.0, 1, builder.data.NombreDePasDeTempsPourUneOptimisation) | ||
.greaterThan() | ||
.build(); | ||
} | ||
|
||
void ShortTermStorageCostVariationInjectionForward::add(unsigned int pdt, unsigned int pays) | ||
{ | ||
addStorageConstraint("ShortTermStorageCostVariationInjectionForward", pdt, pays); | ||
} | ||
|
||
int& ShortTermStorageCostVariationInjectionForward::ShortTermStorageCostVariationInjectionForward:: | ||
TargetConstraintIndex(int pdt, int index) | ||
{ | ||
return data.CorrespondanceCntNativesCntOptim[pdt] | ||
.ShortTermStorageCostVariationInjectionForward[index]; | ||
} | ||
|
||
bool ShortTermStorageCostVariationInjectionForward::IsConstraintEnabled( | ||
const ShortTermStorage::PROPERTIES& properties) | ||
{ | ||
return properties.penalizeVariationInjection; | ||
} |
Oops, something went wrong.