-
Notifications
You must be signed in to change notification settings - Fork 25
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
[ANT-992] Add ramping for thermal clusters #1817
base: develop
Are you sure you want to change the base?
Changes from 9 commits
a64625a
b9c4f2b
624f2ce
915e0c7
f2d469e
e78c034
b9801fe
09a2ca9
5ce4531
77daa36
8133150
134ad57
54ef194
d8ca6aa
d1f983c
70ba583
7387013
ab1b701
8b6ce0b
3b17545
50f7a48
554455d
3625bd2
44f722d
e41d0b8
34f2531
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -340,6 +340,32 @@ class ThermalCluster final : public Cluster, public std::enable_shared_from_this | |||||
double marketBidCost = 0; | ||||||
//! Variable O&M cost (euros/MWh) | ||||||
double variableomcost = 0; | ||||||
|
||||||
struct Ramping | ||||||
{ | ||||||
//! Cost of power increase (euros/MW) | ||||||
double powerIncreaseCost; | ||||||
//! Cost of power decrease (euros/MW) | ||||||
double powerDecreaseCost; | ||||||
//! Maximum hourly upward power ramping rate (MW/hour) | ||||||
double maxUpwardPowerRampingRate; | ||||||
//! Maximum hourly downward power ramping rate (MW/hour) | ||||||
double maxDownwardPowerRampingRate; | ||||||
|
||||||
Ramping() : | ||||||
powerIncreaseCost(0.), | ||||||
powerDecreaseCost(0.), | ||||||
maxUpwardPowerRampingRate(0.), | ||||||
maxDownwardPowerRampingRate(0.) | ||||||
{ | ||||||
} | ||||||
|
||||||
void reset(); | ||||||
bool checkValidity(Area* area, Data::ClusterName clusterName); | ||||||
friend std::ostream& operator<<(std::ostream&, const Ramping& ramping); | ||||||
}; | ||||||
Ramping ramping; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
By default, the ramping constraints are not enabled for a given cluster. They are enabled only if an object exists within this Possible justification : there is no good default value for This induces a small difficulty in the variable/constraint counting process, in the sense that we must only take into account cluster for which ramping is enabled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commit 8133150 implements now is feature |
||||||
|
||||||
//@} | ||||||
|
||||||
/*! | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,24 @@ ConstraintBuilder& ConstraintBuilder::DispatchableProduction(unsigned int index, | |
return *this; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove debug comments There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in commit 624f2ce |
||
} | ||
|
||
ConstraintBuilder& ConstraintBuilder::ProductionDecreaseAboveMin(unsigned int index, | ||
double coeff, | ||
int offset, | ||
int delta) | ||
{ | ||
AddVariable(GetVariableManager(offset, delta).ProductionDecreaseAboveMin(index), coeff); | ||
return *this; | ||
} | ||
|
||
ConstraintBuilder& ConstraintBuilder::ProductionIncreaseAboveMin(unsigned int index, | ||
double coeff, | ||
int offset, | ||
int delta) | ||
{ | ||
AddVariable(GetVariableManager(offset, delta).ProductionIncreaseAboveMin(index), coeff); | ||
return *this; | ||
} | ||
|
||
ConstraintBuilder& ConstraintBuilder::NumberOfDispatchableUnits(unsigned int index, | ||
double coeff, | ||
int offset, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "PowerOutputVariation.h" | ||
|
||
void PowerOutputVariation::add(int pays, int cluster, int clusterIndex, int pdt, bool Simulation) | ||
{ | ||
if (!Simulation) | ||
{ | ||
const PALIERS_THERMIQUES& PaliersThermiquesDuPays = problemeHebdo->PaliersThermiquesDuPays[pays]; | ||
double maxUpwardPowerRampingRate = PaliersThermiquesDuPays.maxUpwardPowerRampingRate[clusterIndex]; | ||
double pminDUnGroupeDuPalierThermique = PaliersThermiquesDuPays.pminDUnGroupeDuPalierThermique[clusterIndex]; | ||
// constraint : P(t) - P(t-1) - l * M^+(t) - P^+ + P^- = 0 | ||
builder.updateHourWithinWeek(pdt) | ||
.DispatchableProduction(cluster, 1.0) | ||
.DispatchableProduction(cluster, -1.0, -1, problemeHebdo->NombreDePasDeTempsPourUneOptimisation) | ||
.NumberStartingDispatchableUnits(cluster, -pminDUnGroupeDuPalierThermique) | ||
.ProductionIncreaseAboveMin(cluster, -1.0) | ||
.ProductionDecreaseAboveMin(cluster, 1.0) | ||
.equalTo(); | ||
|
||
if (builder.NumberOfVariables() > 0) | ||
{ | ||
ConstraintNamer namer(problemeHebdo->ProblemeAResoudre->NomDesContraintes); | ||
|
||
namer.UpdateTimeStep(problemeHebdo->weekInTheYear * 168 + pdt); | ||
namer.UpdateArea(problemeHebdo->NomsDesPays[pays]); | ||
|
||
namer.ProductionOutputVariation(problemeHebdo->ProblemeAResoudre->NombreDeContraintes, PaliersThermiquesDuPays.NomsDesPaliersThermiques[clusterIndex]); | ||
} | ||
builder.build(); | ||
} | ||
else | ||
{ | ||
problemeHebdo->NbTermesContraintesPourLesRampes += 5; | ||
problemeHebdo->ProblemeAResoudre->NombreDeContraintes++; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
#include "ConstraintBuilder.h" | ||
|
||
/*! | ||
* represent 'RampingIncreaseRate' Constraint type | ||
*/ | ||
class PowerOutputVariation : private ConstraintFactory | ||
{ | ||
public: | ||
using ConstraintFactory::ConstraintFactory; | ||
|
||
/*! | ||
* @brief Add variables to the constraint and update constraints Matrix | ||
* @param pays : area | ||
* @param cluster : global index of the cluster | ||
* @param pdt : timestep | ||
* @param Simulation : --- | ||
*/ | ||
void add(int pays, int cluster, int clusterIndex, int pdt, bool Simulation); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "RampingDecreaseRate.h" | ||
|
||
void RampingDecreaseRate::add(int pays, int cluster, int clusterIndex, int pdt, bool Simulation) | ||
{ | ||
if (!Simulation) | ||
{ | ||
const PALIERS_THERMIQUES& PaliersThermiquesDuPays = problemeHebdo->PaliersThermiquesDuPays[pays]; | ||
double maxDownwardPowerRampingRate = PaliersThermiquesDuPays.maxDownwardPowerRampingRate[clusterIndex]; | ||
double pmaxDUnGroupeDuPalierThermique = PaliersThermiquesDuPays.PmaxDUnGroupeDuPalierThermique[clusterIndex]; | ||
// constraint : P(t) - P(t-1) + R^- * M(t) + u * M^-(t) + u * M^--(t) > 0 | ||
flomnes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
builder.updateHourWithinWeek(pdt) | ||
.DispatchableProduction(cluster, 1.0) | ||
.DispatchableProduction(cluster, -1.0, -1, problemeHebdo->NombreDePasDeTempsPourUneOptimisation) | ||
.NumberOfDispatchableUnits(cluster, maxDownwardPowerRampingRate) | ||
.NumberStoppingDispatchableUnits(cluster, pmaxDUnGroupeDuPalierThermique) | ||
.NumberBreakingDownDispatchableUnits(cluster, pmaxDUnGroupeDuPalierThermique) | ||
.greaterThan(); | ||
|
||
if (builder.NumberOfVariables() > 0) | ||
{ | ||
ConstraintNamer namer(problemeHebdo->ProblemeAResoudre->NomDesContraintes); | ||
|
||
namer.UpdateTimeStep(problemeHebdo->weekInTheYear * 168 + pdt); | ||
namer.UpdateArea(problemeHebdo->NomsDesPays[pays]); | ||
|
||
namer.RampingDecreaseRate(problemeHebdo->ProblemeAResoudre->NombreDeContraintes, | ||
PaliersThermiquesDuPays.NomsDesPaliersThermiques[clusterIndex]); | ||
} | ||
builder.build(); | ||
} | ||
else | ||
{ | ||
problemeHebdo->NbTermesContraintesPourLesRampes += 5; | ||
problemeHebdo->ProblemeAResoudre->NombreDeContraintes++; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
#include "ConstraintBuilder.h" | ||
|
||
/*! | ||
* represent 'RampingIncreaseRate' Constraint type | ||
*/ | ||
class RampingDecreaseRate : private ConstraintFactory | ||
{ | ||
public: | ||
using ConstraintFactory::ConstraintFactory; | ||
|
||
/*! | ||
* @brief Add variables to the constraint and update constraints Matrix | ||
* @param pays : area | ||
* @param cluster : global index of the cluster | ||
* @param pdt : timestep | ||
* @param Simulation : --- | ||
*/ | ||
void add(int pays, int cluster, int clusterIndex, int pdt, bool Simulation); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constructor is called by default, there is no need to call it explicitly here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed in commit 77daa36