Skip to content

Commit

Permalink
Add priceCSR.h
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Jan 7, 2025
1 parent 74d5b54 commit 2cc8f53
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 58 deletions.
15 changes: 13 additions & 2 deletions src/solver/optimisation/post_process_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
*/

#include "antares/solver/optimisation/post_process_commands.h"

#include "antares/solver/optimisation/adequacy_patch_csr/adq_patch_curtailment_sharing.h"
#include "antares/solver/optimisation/post_process_commands.h"
#include "antares/solver/simulation/adequacy_patch_runtime_data.h"
#include "antares/solver/simulation/common-eco-adq.h"

Expand Down Expand Up @@ -143,6 +142,18 @@ void UpdateMrgPriceAfterCSRcmd::execute(const optRuntimeData&)
const bool isHourTriggeredByCsr = problemeHebdo_->adequacyPatchRuntimeData
->wasCSRTriggeredAtAreaHour(Area, hour);

// IF UNSP. ENR CSR == 0, MRG. PRICE CSR = MRG. PRICE
// ELSE, MRG. PRICE CSR = “Unsupplied Energy Cost”
if (hourlyResults.ValeursHorairesDeDefaillancePositiveCSR[hour] > 0.5 && areaInside)
{
hourlyResults.CoutsMarginauxHorairesCSR[hour] = -unsuppliedEnergyCost;
}
else
{
hourlyResults.CoutsMarginauxHorairesCSR[hour] = hourlyResults
.CoutsMarginauxHoraires[hour];
}

if (isHourTriggeredByCsr
&& hourlyResults.ValeursHorairesDeDefaillancePositive[hour] > 0.5 && areaInside)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ struct RESULTATS_HORAIRES
std::vector<double> debordementsHoraires;

std::vector<double> CoutsMarginauxHoraires;
std::vector<double> CoutsMarginauxHorairesCSR;
std::vector<PRODUCTION_THERMIQUE_OPTIMALE> ProductionThermique; // index is pdtHebdo

std::vector<::ShortTermStorage::RESULTS> ShortTermStorage;
Expand Down
1 change: 1 addition & 0 deletions src/solver/variable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ set(SRC_VARIABLE_ECONOMY
include/antares/solver/variable/economy/STStorageCashFlowByCluster.h
include/antares/solver/variable/economy/unsupliedEnergy.h
include/antares/solver/variable/economy/unsupliedEnergyCsr.h
include/antares/solver/variable/economy/priceCSR.h
include/antares/solver/variable/economy/domesticUnsuppliedEnergy.h
include/antares/solver/variable/economy/localMatchingRuleViolations.h
include/antares/solver/variable/economy/dtgMarginAfterCsr.h
Expand Down
115 changes: 59 additions & 56 deletions src/solver/variable/include/antares/solver/variable/economy/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include "overallCost.h"
#include "overallCostCsr.h"
#include "overflow.h"
#include "priceCSR.h"
#include "pumping.h"
#include "renewableGeneration.h"
#include "reservoirlevel.h"
Expand Down Expand Up @@ -95,62 +96,64 @@ namespace Antares::Solver::Variable::Economy
/*!
** \brief All variables for a single area (economy)
*/
typedef // Prices
OverallCost // Overall Cost (Op. Cost + Unsupplied Eng.)
<OverallCostCsr // Overall Cost after CSR (adequacy patch Curtailment ShaRing)
<OperatingCost // Operating Cost
<Price // Marginal price
// Thermal pollutants
<ThermalAirPollutantEmissions // Overall pollutant emissions(from all thermal dispatchable
// clusters) Production by thermal cluster
<ProductionByDispatchablePlant // Energy generated by thermal dispatchable clusters
<ProductionByRenewablePlant // Energy generated by renewable clusters (must-run)
<Balance // Nodal Energy Balance
// Misc Gen.
<RowBalance // Misc Gen. Row balance
<PSP // PSP
<MiscGenMinusRowPSP // Misc Gen. - Row Balance - PSP
// Time series
<TimeSeriesValuesLoad // Load
<TimeSeriesValuesHydro // Hydro
<TimeSeriesValuesWind // Wind
<TimeSeriesValuesSolar // Solar
// Other
<DispatchableGeneration // All dispatchable generation
<RenewableGeneration // All renewable generation
<HydroStorage // Hydro Storage Generation
<Pumping // Pumping generation
<ReservoirLevel // Reservoir levels
<Inflows // Hydraulic inflows
<Overflows // Hydraulic overflows
<WaterValue // Water values
<HydroCost // Hydro costs
<STSbyGroup<STstorageInjectionByCluster<STstorageWithdrawalByCluster<
STstorageLevelsByCluster<STstorageCashFlowByCluster<
UnsupliedEnergy // Unsuplied Energy
<UnsupliedEnergyCSR // Unsupplied energy CSR
<DomesticUnsuppliedEnergy // Domestic Unsupplied Energy
<LMRViolations // LMR Violations
<SpilledEnergy // Spilled Energy
<LOLD // LOLD
<LOLD_CSR<LOLP // LOLP
<LOLP_CSR<AvailableDispatchGen<DispatchableGenMargin<
DtgMarginCsr // DTG MRG CSR
<Marge<MaxMrgCsr<NonProportionalCost<
NonProportionalCostByDispatchablePlant // Startup
// cost +
// Fixed cost
// per
// thermal
// plant
// detail
<NbOfDispatchedUnits // Number of Units Dispatched
<NbOfDispatchedUnitsByPlant // Number of Units
// Dispatched by plant
<ProfitByPlant
// Links
<Variable::Economy::Links // All links
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
typedef // Prices
OverallCost // Overall Cost (Op. Cost + Unsupplied Eng.)
<OverallCostCsr // Overall Cost after CSR (adequacy patch Curtailment ShaRing)
<OperatingCost // Operating Cost
<Price // Marginal price
<PriceCSR
// Thermal pollutants
<ThermalAirPollutantEmissions // Overall pollutant emissions(from all thermal dispatchable
// clusters) Production by thermal cluster
<ProductionByDispatchablePlant // Energy generated by thermal dispatchable clusters
<ProductionByRenewablePlant // Energy generated by renewable clusters (must-run)
<Balance // Nodal Energy Balance
// Misc Gen.
<RowBalance // Misc Gen. Row balance
<PSP // PSP
<MiscGenMinusRowPSP // Misc Gen. - Row Balance - PSP
// Time series
<TimeSeriesValuesLoad // Load
<TimeSeriesValuesHydro // Hydro
<TimeSeriesValuesWind // Wind
<TimeSeriesValuesSolar // Solar
// Other
<DispatchableGeneration // All dispatchable generation
<RenewableGeneration // All renewable generation
<HydroStorage // Hydro Storage Generation
<Pumping // Pumping generation
<ReservoirLevel // Reservoir levels
<Inflows // Hydraulic inflows
<Overflows // Hydraulic overflows
<WaterValue // Water values
<HydroCost // Hydro costs
<STSbyGroup<STstorageInjectionByCluster<STstorageWithdrawalByCluster<
STstorageLevelsByCluster<STstorageCashFlowByCluster<
UnsupliedEnergy // Unsuplied Energy
<UnsupliedEnergyCSR // Unsupplied energy CSR
<DomesticUnsuppliedEnergy // Domestic Unsupplied Energy
<LMRViolations // LMR Violations
<SpilledEnergy // Spilled Energy
<LOLD // LOLD
<LOLD_CSR<
LOLP // LOLP
<LOLP_CSR<AvailableDispatchGen<DispatchableGenMargin<
DtgMarginCsr // DTG MRG CSR
<Marge<MaxMrgCsr<NonProportionalCost<
NonProportionalCostByDispatchablePlant // Startup
// cost +
// Fixed cost
// per
// thermal
// plant
// detail
<NbOfDispatchedUnits // Number of Units Dispatched
<NbOfDispatchedUnitsByPlant // Number of Units
// Dispatched by plant
<ProfitByPlant
// Links
<Variable::Economy::Links // All links
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
VariablesPerArea;

/*!
Expand Down
Loading

0 comments on commit 2cc8f53

Please sign in to comment.