Title: | 'Antares' Results Processing |
---|---|
Description: | Process results generated by 'Antares', a powerful open source software developed by RTE (Réseau de Transport d’Électricité) to simulate and study electric power systems (more information about 'Antares' here: <https://github.com/AntaresSimulatorTeam/Antares_Simulator>). This package provides functions to create new columns like net load, load factors, upward and downward margins or to compute aggregated statistics like economic surpluses of consumers, producers and sectors. |
Authors: | Tatiana Vargas [aut, cre], Jalal-Edine ZAWAM [aut], Francois Guillem [aut], Benoit Thieurmel [aut], Titouan Robert [aut], RTE [cph] |
Maintainer: | Tatiana Vargas <[email protected]> |
License: | GPL (>= 2) | file LICENSE |
Version: | 0.18.2 |
Built: | 2024-11-27 15:30:21 UTC |
Source: | https://github.com/rte-antares-rpackage/antaresprocessing |
This function computes 4 congestion variables of link (congestion frequency and congestion hours in direct and indirect direction) and adds them to an
antaresData
object. The input object must be at an hourly timestep.
addCongestionLink(x, timeStep = c("daily", "weekly", "monthly", "annual"))
addCongestionLink(x, timeStep = c("daily", "weekly", "monthly", "annual"))
x |
Object of class |
timeStep |
|
addCongestionLink
modifies its input by adding four columns:
congestionFrequencyDirect |
This is the congestion frequency on the direct direction of the link at the specified time resolution. congestionFrequencyDirect = round(sum((`CONG. PROB +` != 0)/.N), 2) |
congestionFrequencyIndirect |
This is the congestion frequency on the indirect direction of the link at the specified time resolution. congestionFrequencyIndirect = round(sum((`CONG. PROB -` != 0)/.N), 2) |
congestionHoursDirect |
This is the number of congestion hours on the direct direction of the link at the specified time resolution. congestionHoursDirect = sum(`CONG. PROB +` != 0) |
congestionHoursIndirect |
This is the number of congestion hours on the direct direction of the link at the specified time resolution. congestionHoursIndirect = sum(`CONG. PROB -` != 0) |
## Not run: # Data required by the function mydata <- readAntares(links = "all") mydata <- addCongestionLink(mydata, timeStep = "daily") names(mydata) mydata <- addCongestionLink(mydata, timeStep = c('daily')) ## End(Not run)
## Not run: # Data required by the function mydata <- readAntares(links = "all") mydata <- addCongestionLink(mydata, timeStep = "daily") names(mydata) mydata <- addCongestionLink(mydata, timeStep = c('daily')) ## End(Not run)
This function computes isolated and interconnected downward margins of areas and add them to an antaresData object.
addDownwardMargin(x)
addDownwardMargin(x)
x |
An object of class |
For a given area, downward margin is equal to the thermal minimum production (due must run production and minimum stable power of production units) plus the fatal productions minus the load and the pumping capacity. More formally it is equal to:
isolatedDownwardMargin = thermalPMin + `H. ROR` + WIND + SOLAR + `MISC. NDG`
- LOAD - pumpingCapacity
The variable pumpingCapacity
is automatically created when pumped
storage areas are removed with function
removeVirtualAreas
. If there is not any such area,
pumpingCapacity
is assumed to be equal to 0.
Interconnected downward margin is the isolated downward margin plus the exports minus the imports:
interconnectedDownwardMargin = isolatedDownwardMargin + BALANCE - `ROW BAL.`
The function modifies its input by adding to it two new columns
isolatedDownwardMargin
and interconnectedDownwardMargin
. For
convenience it invisibly returns x
.
## Not run: # data required by the function showAliases("downwardMargin") mydata <- readAntares(select = "downwardMargin") mydata <- removeVirtualAreas(mydata, getAreas(c("pump", "stor"))) addDownwardMargin(mydata) names(mydata$areas) ## End(Not run)
## Not run: # data required by the function showAliases("downwardMargin") mydata <- readAntares(select = "downwardMargin") mydata <- removeVirtualAreas(mydata, getAreas(c("pump", "stor"))) addDownwardMargin(mydata) names(mydata$areas) ## End(Not run)
This function computes the export and import of areas or districts and add it to an
antaresData
object.
addExportAndImport(x, addCapacities = FALSE, opts = NULL)
addExportAndImport(x, addCapacities = FALSE, opts = NULL)
x |
an object of class "antaresDataList" created with the function
|
addCapacities |
If |
opts |
opts |
addExportAndImport
modifies its input by adding to it columns:
export |
export for an area or district |
import |
import for an area or district |
capExport |
capacity of export for an area or district, if |
capImport |
capacity of import for an area or district, if |
## Not run: # Data required by the function showAliases("exportsImports") mydata <- readAntares(select = "exportsImports") addExportAndImport(mydata) names(mydata$areas) ## End(Not run)
## Not run: # Data required by the function showAliases("exportsImports") mydata <- readAntares(select = "exportsImports") addExportAndImport(mydata) names(mydata$areas) ## End(Not run)
This function computes the load factor of link and add it to an
antaresData
object.
addLoadFactorLink(x)
addLoadFactorLink(x)
x |
Object of class |
addLoadFactorLink
modifies its input by adding to it two columns:
loadFactor |
Proportion of the installed capacity of a link that is effectively used: loadFactor = `FLOW LIN` / transCapacity Notice that |
congestion |
1 if the link is saturated ( |
For convenience, the function invisibly returns the modified input.
## Not run: # Data required by the function showAliases("loadFactorLink") mydata <- readAntares(select = "loadFactorLink") addLoadFactorLink(mydata) names(mydata) ## End(Not run)
## Not run: # Data required by the function showAliases("loadFactorLink") mydata <- readAntares(select = "loadFactorLink") addLoadFactorLink(mydata) names(mydata) ## End(Not run)
This function computes the net load of areas or districts and add it to an
antaresData
object. Net load is the load of an area minus productions
that are not controlled: wind, solar, hydraulic run of river, etc. the
production of clusters in must run mode is also subtracted by default.
addNetLoad(x, ignoreMustRun = FALSE)
addNetLoad(x, ignoreMustRun = FALSE)
x |
An |
ignoreMustRun |
If |
addNetLoad
modifies its input by adding to it a column "netLoad". For
convenience, it invisibly returns the modified input.
formula = LOAD - 'ROW BAL.' - PSP - 'MISC. NDG' - 'H. ROR' - WIND - SOLAR - mustRunTotal
## Not run: # Data required by the function showAliases("netLoad") mydata <- readAntares(select = "netLoad") addNetLoad(mydata) names(mydata) ## End(Not run)
## Not run: # Data required by the function showAliases("netLoad") mydata <- readAntares(select = "netLoad") addNetLoad(mydata) names(mydata) ## End(Not run)
This function computes isolated and interconnected upward margins of areas and add them to an antaresData object.
addUpwardMargin(x)
addUpwardMargin(x)
x |
An object of class |
For a given area and time step, isolated upward margin is the difference between the available production capacity plus the fatal productions and the load. More formally it is equal to:
isolatedUpwardMargin = (`AVL DTG` + generatingMaxPower + storageCapacity) +
(`H. ROR` + WIND + SOLAR + `MISC. NDG`) - LOAD
NB: in Antares v6 (and earlier versions) generatingMaxPower
is replaced
by hstorPMaxAvg
.
The variable storageCapacity
is automatically created when pumped
storage areas are removed with function
removeVirtualAreas
. If there is not any such area,
storageCapacity
is assumed to be equal to 0.
Interconnected upward margin is the isolated upward margin plus the imports and minus the exports:
interconnectedUpwardMargin = isolatedUpwardMargin - BALANCE + `ROW BAL.`
The function modifies its input by adding to it two new columns
isolatedUpwardMargin
and interconnectedUpwardMargin
. For
convenience it invisibly returns x
.
## Not run: # Data required by the function showAliases("upwardMargin") mydata <- readAntares(select = "upwardMargin") mydata <- removeVirtualAreas(mydata, getAreas(c("pump", "stor"))) addUpwardMargin(mydata) ## End(Not run)
## Not run: # Data required by the function showAliases("upwardMargin") mydata <- readAntares(select = "upwardMargin") mydata <- removeVirtualAreas(mydata, getAreas(c("pump", "stor"))) addUpwardMargin(mydata) ## End(Not run)
compare
has been designed to compare two surpluses created with function
"surplus" but it can be used to compare the values of two tables of
class antaresData
that contain the same type of data.
compare(x, y, method = c("diff", "ratio", "rate"))
compare(x, y, method = c("diff", "ratio", "rate"))
x |
Table of class |
y |
Table of class |
method |
Method used two compare the two tables. |
a data.table of class antaresDataTable
. It contains all shared rows and
columns between 'x' and 'y'. The columns contain the statistic chosen:
difference, ratio or rate of change.
## Not run: # First simulation studyPath <- "path/to/study/" setSimulationPath(studyPath, 1) mydata1 <- readAntares("all", "all", synthesis = FALSE) surplus1 <- surplus(mydata1, groupByDistrict = TRUE) # Second simulation setSimulationPath(studyPath, 2) mydata2 <- readAntares("all", "all", synthesis = FALSE) surplus2 <- surplus(mydata2, groupByDistrict = TRUE) compare(surplus1, surplus2) opts1 <- setSimulationPath(studyPath,-1) mydata1<-readAntares(areas = "all", links = "all", select = c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) opts2 <- setSimulationPath(studyPath,-2) mydata2 <- readAntares(areas = "all", links = "all", select = c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) opts3 <- setSimulationPath(studyPath,-3) mydata3 <- readAntares(areas = "all", links = "all", select = c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) opts4 <- setSimulationPath(studyPath, -4) mydata4 <- readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) opts5 <- setSimulationPath(studyPath, -5) mydata5 <- readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) resCompare1 <- compare(mydata2, mydata1, method = "diff") resCompare2 <- compare(mydata3, mydata1, method = "diff") resCompare3 <- compare(mydata4, mydata1, method = "diff") resCompare4 <- compare(mydata5, mydata1, method = "diff") listCompare <- list(resCompare1, resCompare2, resCompare3, resCompare4) for (i in 1:length(listCompare)){ listCompare[[i]] <- removeVirtualAreas(listCompare[[i]], storageFlexibility = getAreas(select = c("z_dsr", "y_mul", "pum", "tur"))) } ml <- readRDS("path/to/mapLayout.rds") plotMap(listCompare, ml) ## End(Not run)
## Not run: # First simulation studyPath <- "path/to/study/" setSimulationPath(studyPath, 1) mydata1 <- readAntares("all", "all", synthesis = FALSE) surplus1 <- surplus(mydata1, groupByDistrict = TRUE) # Second simulation setSimulationPath(studyPath, 2) mydata2 <- readAntares("all", "all", synthesis = FALSE) surplus2 <- surplus(mydata2, groupByDistrict = TRUE) compare(surplus1, surplus2) opts1 <- setSimulationPath(studyPath,-1) mydata1<-readAntares(areas = "all", links = "all", select = c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) opts2 <- setSimulationPath(studyPath,-2) mydata2 <- readAntares(areas = "all", links = "all", select = c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) opts3 <- setSimulationPath(studyPath,-3) mydata3 <- readAntares(areas = "all", links = "all", select = c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) opts4 <- setSimulationPath(studyPath, -4) mydata4 <- readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) opts5 <- setSimulationPath(studyPath, -5) mydata5 <- readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE) resCompare1 <- compare(mydata2, mydata1, method = "diff") resCompare2 <- compare(mydata3, mydata1, method = "diff") resCompare3 <- compare(mydata4, mydata1, method = "diff") resCompare4 <- compare(mydata5, mydata1, method = "diff") listCompare <- list(resCompare1, resCompare2, resCompare3, resCompare4) for (i in 1:length(listCompare)){ listCompare[[i]] <- removeVirtualAreas(listCompare[[i]], storageFlexibility = getAreas(select = c("z_dsr", "y_mul", "pum", "tur"))) } ml <- readRDS("path/to/mapLayout.rds") plotMap(listCompare, ml) ## End(Not run)
This function computes the dependency in imports and export for each area or districts at a given time step. Dependency in imports represents moments where imports are required to have no loss of load. Dependency in exports represents moments where exports are required to have no spilled energy.
externalDependency(x, timeStep = "annual", synthesis = FALSE, opts = NULL)
externalDependency(x, timeStep = "annual", synthesis = FALSE, opts = NULL)
x |
An object created with function Moreover it needs to have a hourly time step. This object must also contain linkCapacity if there was virtual areas
remove by |
timeStep |
Desired time step for the result. |
synthesis |
If TRUE, average external dependencies are returned. Else the function returns external dependencies per Monte-Carlo scenario. |
opts |
opts |
A data.table of class antaresDataTable
with the following columns:
area |
Area name. |
timeId |
Time id and other time columns. |
pumping |
capacity of pumping |
storage |
capacity of storage |
exportsLevel |
netLoad + pumping |
importsLevel |
netLoad - 'AVL DTG' - hydroStorageMaxPower - storage > 0 |
exportsFrequency |
number of time step where this criteria is satisfied criteria : netLoad + pumping < 0 |
importsFrequency |
number of time step where this criteria is satisfied criteria : netLoad - 'AVL DTG' - hydroStorageMaxPower - storage > 0 |
## Not run: # Data required by the function showAliases("externalDependency") mydata <- readAntares(select = "externalDependency") addNetLoad(mydata) externalDependency(mydata) # if there are some virtual pumping/storage areas, remove them with # removeVirtualAreas mydata <- removeVirtualAreas(mydata, c("pumping", "storage")) externalDependency(mydata, ignoreMustRun = TRUE) ## End(Not run)
## Not run: # Data required by the function showAliases("externalDependency") mydata <- readAntares(select = "externalDependency") addNetLoad(mydata) externalDependency(mydata) # if there are some virtual pumping/storage areas, remove them with # removeVirtualAreas mydata <- removeVirtualAreas(mydata, c("pumping", "storage")) externalDependency(mydata, ignoreMustRun = TRUE) ## End(Not run)
Get all the values of a variable for some years Monte Carlo
getValues(data = NULL, variable = NULL, mcyear = "all")
getValues(data = NULL, variable = NULL, mcyear = "all")
data |
an object of class "antaresData" created with the function
|
variable |
a variable of data |
mcyear |
set of mcYear |
## Not run: mydata <- readAntares(areas="all",clusters="all", select="LOAD") getValues(mydata$areas, variable="LOAD") getValues(myData$clusters, variable = "production") ## End(Not run)
## Not run: mydata <- readAntares(areas="all",clusters="all", select="LOAD") getValues(mydata$areas, variable="LOAD") getValues(myData$clusters, variable = "production") ## End(Not run)
This function computes the load factor and other related statistics for cluster of a study.
loadFactor( x, timeStep = "annual", synthesis = FALSE, clusterDesc = NULL, loadFactorAvailable = FALSE, opts = NULL )
loadFactor( x, timeStep = "annual", synthesis = FALSE, clusterDesc = NULL, loadFactorAvailable = FALSE, opts = NULL )
x |
Object of class |
timeStep |
Desired time step for the result. |
synthesis |
If TRUE, average surpluses are returned. Else the function returns surpluses per Monte-Carlo scenario. |
clusterDesc |
A table created with the function |
loadFactorAvailable |
Should loadFactorAvailable be added to the result? |
opts |
opts where clusterDesc will be read if null based on data |
a data.table of class antaresDataTable
containing the following
columns:
area |
Area name |
cluster |
Cluster name |
mcYear |
Only if |
timeId |
Time id and other time variables |
loadFactor |
Load factor of the cluster. It represent the proportion of the installed capacity of a cluster that is effectively generate Formula: production / (unitcount * nominalcapacity) |
#'
loadFactorAvailable |
Load factor of the cluster. It represent the proportion of the capacity available of a cluster that is effectively generate Formula: production / thermalAvailability |
propHoursMinGen |
Proportion of hours when production is positive and all units of a cluster are either off, either producing at their minimum. This situation occurs when units are kept producing above the optimal level to avoid future startup costs or to satisfy the constraints generated by parameters "Min. up Time" or "Min gen. modulation". Formula: mean(1 if production > 0 and production = max(min.stable.power * unitcount, minGenModulation * nominalcapacity * unitcount) else 0) |
propHoursMaxGen |
Proportion of hours when all units started produce at their maximal capacity. Formula: mean(1 if production > 0 and production = NODU * nominalcapacity * (1 - spinning / 100)) |
## Not run: # data required by the function showAliases("loadfactor") mydata <- readAntares(select = "loadfactor") loadFactor(mydata, synthesis = TRUE) ## End(Not run)
## Not run: # data required by the function showAliases("loadfactor") mydata <- readAntares(select = "loadfactor") loadFactor(mydata, synthesis = TRUE) ## End(Not run)
Merge all antaresDataSets
mergeAllAntaresData(dta)
mergeAllAntaresData(dta)
dta |
antaresData |
## Not run: setSimulationPath("Mystud", 1) dta <- readAntares(areas = "all", links = "all", clusters = "all", districts = "all") dta <- mergeAllAntaresData(dta) ## End(Not run)
## Not run: setSimulationPath("Mystud", 1) dta <- readAntares(areas = "all", links = "all", clusters = "all", districts = "all") dta <- mergeAllAntaresData(dta) ## End(Not run)
This function computes the modulation of cluster units or of sectors.
modulation( x, timeStep = "annual", synthesis = FALSE, by = c("cluster", "sector"), clusterDesc = NULL, opts = NULL )
modulation( x, timeStep = "annual", synthesis = FALSE, by = c("cluster", "sector"), clusterDesc = NULL, opts = NULL )
x |
An |
timeStep |
Desired time step for the result. |
synthesis |
If TRUE, average surpluses are returned. Else the function returns surpluses per Monte-Carlo scenario. |
by |
Should modulations computed by cluster or by sector? Possible values are "sector" and "cluster". |
clusterDesc |
A table created with the function |
opts |
opts where clusterDesc will be read if null based on data |
A data.table of class antaresDataTable
or a list of such tables with
the following columns:
area |
Area name. If |
cluster |
Cluster name. If |
timeId |
Time id and other time columns. |
upwardModulation |
Maximal absolute modulation of a cluster unit or of the sector, if |
downwardModulation |
Maximal absolute modulation of a cluster unit or of the sector, if |
absoluteModulation |
Maximal absolute modulation of a cluster unit or of the sector, if |
avg_upwardModulation |
Average upward modulation of a cluster unit or of the sector, if |
avg_downwardModulation |
Average downward modulation of a cluster unit or of the sector, if |
avg_absoluteModulation |
Average absolute modulation of a cluster unit or of the sector, if |
max_upwardModulation |
Maximal upward modulation of a cluster unit or of the sector, if |
max_downwardModulation |
Maximal downward modulation of a cluster unit or of the sector, if |
max_absoluteModulation |
Maximal absolute modulation of a cluster unit or of the sector, if |
Notice that if by="cluster"
, the function computes the modulation per
unit, i.e. the modulation of a cluster divided by the number of units of the
cluster. On the opposite, if by="sector"
, the function returns the
modulation of the global production of the sector. Moreover, if parameter
x
contains area and district data, the function returns a list with
components areas
and districts
.
## Not run: # data required by the function showAliases("modulation") mydata <- readAntares(select="modulation") # Modulation of cluster units modulation(mydata) # Aggregate Monte-Carlo scenarios modulation(mydata, synthesis = TRUE) # Modulation of sectors modulation(mydata, by = "sector") # Modulation of sectors per district modulation(mydata, by = "sector") ## End(Not run)
## Not run: # data required by the function showAliases("modulation") mydata <- readAntares(select="modulation") # Modulation of cluster units modulation(mydata) # Aggregate Monte-Carlo scenarios modulation(mydata, synthesis = TRUE) # Modulation of sectors modulation(mydata, by = "sector") # Modulation of sectors per district modulation(mydata, by = "sector") ## End(Not run)
This function computes the ramp of the consumption and the balance of areas and/or districts.
netLoadRamp( x, timeStep = "hourly", synthesis = FALSE, ignoreMustRun = FALSE, opts = NULL )
netLoadRamp( x, timeStep = "hourly", synthesis = FALSE, ignoreMustRun = FALSE, opts = NULL )
x |
Object of class |
timeStep |
Desired time step for the result. |
synthesis |
If TRUE, average surpluses are returned. Else the function returns surpluses per Monte-Carlo scenario. |
ignoreMustRun |
Should the must run production be ignored in the computation of the net load? |
opts |
opts where clusterDesc will be read if null based on data |
netLoadRamp
returns a data.table or a list of data.tables with the
following columns:
netLoadRamp |
Ramp of the net load of an area. If |
balanceRamp |
Ramp of the balance of an area. If formula = BALANCE - shift(BALANCE, fill = 0) |
areaRamp |
Sum of the two previous columns. If formula = netLoadRamp + balanceRamp |
minNetLoadRamp |
Minimum ramp of the net load of an area, if |
minBalanceRamp |
Minimum ramp of the balance of an area, if |
minAreaRamp |
Minimum ramp sum of the sum of balance and net load, if |
maxNetLoadRamp |
Maximum ramp of the net load of an area, if |
maxBalanceRamp |
Maximum ramp of the balance of an area, if |
maxAreaRamp |
Maximum ramp of the sum of balance and net load, if |
For convenience the function invisibly returns the modified input.
## Not run: # data required by the function showAliases("netLoadRamp") mydata <- readAntares(select="netLoadRamp") netLoadRamp(mydata, timeStep = "annual") ## End(Not run)
## Not run: # data required by the function showAliases("netLoadRamp") mydata <- readAntares(select="netLoadRamp") netLoadRamp(mydata, timeStep = "annual") ## End(Not run)
This function computes the economic surplus for the consumers, the producers and the global surplus of an area.
surplus( x, timeStep = "annual", synthesis = FALSE, groupByDistrict = FALSE, hurdleCost = TRUE, opts = NULL )
surplus( x, timeStep = "annual", synthesis = FALSE, groupByDistrict = FALSE, hurdleCost = TRUE, opts = NULL )
x |
an object of class "antaresDataList" created with the function
|
timeStep |
Desired time step for the result. |
synthesis |
If TRUE, average surpluses are returned. Else the function returns surpluses per Monte-Carlo scenario. |
groupByDistrict |
If TRUE, results are grouped by district. |
hurdleCost |
If TRUE, HURDLE COST will be removed from congestionFees. |
opts |
opts |
A data.table with the following columns:
area |
Name of the area. |
timeId |
timeId and other time columns. |
consumerSurplus |
The surplus of the consumers of some area. formula = (unsuppliedCost[area] - 'MRG. PRICE') * LOAD |
producerSurplus |
The surplus of the producers of some area. formula = 'MRG. PRICE' * production - 'OP. COST' Production includes "NUCLEAR", "LIGNITE", "COAL", "GAS", "OIL", "MIX. FUEL", "MISC. DTG", "H. STOR", "H. ROR", "WIND", "SOLAR" and "MISC. NDG" |
rowBalanceSurplus |
Surplus of the ROW balance. Formula: 'MRG. PRICE' * 'ROW BAL.' |
storageSurplus |
Surplus created by storage/flexibility areas. formula = storage * x$areas$'MRG. PRICE' |
congestionFees |
The congestion fees of a given area. It equals to half the congestion fees of the links connected to that area. formula = (congestionFees-hurdleCost) / 2 |
globalSurplus |
Sum of the consumer surplus, the producer surplus and the congestion fees. formula = consumerSurplus + producerSurplus + storageSurplus + congestionFees + rowBalanceSurplus |
## Not run: showAliases("surplus") mydata <- readAntares(select="surplus") surplus(mydata) surplus(mydata, synthesis = TRUE) surplus(mydata, synthesis = TRUE, groupByDistrict = TRUE) ## End(Not run)
## Not run: showAliases("surplus") mydata <- readAntares(select="surplus") surplus(mydata) surplus(mydata, synthesis = TRUE) surplus(mydata, synthesis = TRUE, groupByDistrict = TRUE) ## End(Not run)
This function computes the surplus of clusters of interest. The surplus of a cluster is equal to its production times the marginal cost of the area it belongs to minus variable, fixed and startup costs.
surplusClusters( x, timeStep = "annual", synthesis = FALSE, surplusLastUnit = FALSE, clusterDesc = NULL, opts = NULL )
surplusClusters( x, timeStep = "annual", synthesis = FALSE, surplusLastUnit = FALSE, clusterDesc = NULL, opts = NULL )
x |
An |
timeStep |
Desired time step for the result. |
synthesis |
If TRUE, average surpluses are returned. Else the function returns surpluses per Monte-Carlo scenario. |
surplusLastUnit |
Should the surplus of the last unit of a cluster be computed ? If
|
clusterDesc |
A table created with the function |
opts |
opts where clusterDesc will be read if null based on data |
A data.table of class antaresDataTable
with the following columns:
area |
Area name. |
cluster |
Cluster name. |
timeId |
Time id and other time columns. |
variableCost |
Proportional costs of production of the cluster Formula = marginal cost * production |
fixedCost |
Fixed costs of production of the cluster Formula = NODU * fixed cost |
startupCost |
Start up costs of the cluster. |
surplusPerUnit |
Average surplus per unit of the cluster. formula = ('MRG. PRICE' * production - opCost - startupCost) / unitcount |
surplusLastUnit |
Surplus of the last unit of the cluster. formula = ('MRG. PRICE' * prodLastUnit - opCost / pmax(1, NODU) - startup.cost) |
totalSurplus |
Surplus of all units of the cluster. formula = 'MRG. PRICE' * production - opCost - startupCost |
economicGradient |
Economic gradient of a cluster. It is equal to the surplus per unit divided by the capacity of a unit. formula = surplusPerUnit / nominalcapacity |
## Not run: # Data required by the function: showAliases("surplusClusters") mydata <- readAntares(select = "surplusClusters") surplusClusters(mydata) # Computing the surplus of the last unit of a cluster requires the additional # column "availableUnits". To add this column, one has to use parameter # "thermalAvailabilities = TRUE" in readAntares. mydata <- readAntares(select = c("surplusClusters", "thermalAvailabilities")) surplusClusters(mydata, surplusLastUnit = TRUE) ## End(Not run)
## Not run: # Data required by the function: showAliases("surplusClusters") mydata <- readAntares(select = "surplusClusters") surplusClusters(mydata) # Computing the surplus of the last unit of a cluster requires the additional # column "availableUnits". To add this column, one has to use parameter # "thermalAvailabilities = TRUE" in readAntares. mydata <- readAntares(select = c("surplusClusters", "thermalAvailabilities")) surplusClusters(mydata, surplusLastUnit = TRUE) ## End(Not run)
This function computes the surplus of sectors for each area and time step. For sectors wind, solar, hydraulic storage and run of river, production costs are assumed to be equal to 0.
surplusSectors( x, sectors = c("thermal", "renewable"), timeStep = "annual", synthesis = FALSE, groupByDistrict = FALSE, clusterDesc = NULL, opts = NULL )
surplusSectors( x, sectors = c("thermal", "renewable"), timeStep = "annual", synthesis = FALSE, groupByDistrict = FALSE, clusterDesc = NULL, opts = NULL )
x |
Object of class |
sectors |
vector containing the name of the sectors for which surplus needs to be
computed. Possible values are "thermal" for thermal sectors(nuclear, coal,..),
"ren" for renewable energy and any column name that can be considered as
a production (for instance production of virtual areas). It is assumed that
the cost of these productions is equal to 0 as for renewable energies.
If the parameter contains the value "thermal", then the parameter
|
timeStep |
Desired time step for the result. |
synthesis |
If TRUE, average surpluses are returned. Else the function returns surpluses per Monte-Carlo scenario. |
groupByDistrict |
If TRUE, results are grouped by district. |
clusterDesc |
A table created with the function |
opts |
opts |
A data.table of class "antaresData". It contains one column per sector containing the surplus of that sector for a given area and timeId.
## Not run: # Data required by the function: showAliases("surplusSectors") mydata <- readAntares(select = "surplusSectors") surplusSectors(mydata) # Note that if the parameter "sectors" is modified, the function can require # more or less data. For instance, if one only wants surplus for thermal # sectors: mydata <- readAntares(areas = "all", clusters = "all", synthesis = FALSE, select = "MRG. PRICE") surplusSectors(mydata, sectors = "thermal") ## End(Not run)
## Not run: # Data required by the function: showAliases("surplusSectors") mydata <- readAntares(select = "surplusSectors") surplusSectors(mydata) # Note that if the parameter "sectors" is modified, the function can require # more or less data. For instance, if one only wants surplus for thermal # sectors: mydata <- readAntares(areas = "all", clusters = "all", synthesis = FALSE, select = "MRG. PRICE") surplusSectors(mydata, sectors = "thermal") ## End(Not run)
This function takes as input an object of class antaresData
containing
detailed results of a simulation and creates a synthesis of the results.
The synthesis contains the average value of each variable over Monte-Carlo
scenarios and eventually other aggregated statistics
synthesize(x, ..., prefixForMeans = "", useTime = TRUE)
synthesize(x, ..., prefixForMeans = "", useTime = TRUE)
x |
an object of class |
... |
Additional parameters indicating which additional statistics to produce. See details to see how to specify them. |
prefixForMeans |
Prefix to add to the columns containing average values. If it is different than "", a "_" is automatically added. |
useTime |
use times columns for synthesize. |
Additional statistics can be asked in three different ways:
A character string in "min", "max", "std", "median" or "qXXX" where "XXX" is a real number between 0 and 100. It will add for each column respectively the minimum or maximum value, the standard deviation, the median or a quantile.
A named argument whose value is a function or one of the previous
aliases. For instance med = median
will calculate the median of
each variable. The name of the resulting column will be prefixed by
"med_". Similarly, l = "q5"
will compute the 5
each variable and put the result in a column with name prefixed by "l_"
A named argument whose value is a list. It has to contain an element
fun
equal to a function or an alias and optionally an element
only
containing the names of the columns to which to apply the function.
For instance med = list(fun = median, only = c("LOAD", "MRG. PRICE"))
will compute the median of variables "LOAD" and "MRG. PRICE". The result
will be stored in columns "med_LOAD" and "med_MRG. PRICE".
The computation of custom statistics can take some time, especially with hourly data. To improve performance, prefer the third form and compute custom statistics only on a few variables.
Synthetic version of the input data. It has the same structure as x
except that column mcYear
has been removed. All variables are
averaged across Monte-Carlo scenarios and eventually some additional columns
have been added corresponding to the requested custom statistics.
## Not run: mydata <- readAntares("all", timeStep = "annual") synthesize(mydata) # Add minimum and maximum for all variables synthesize(mydata, "min", "max") # Compute a custom statistic for all columns synthesize(mydata, log = function(x) mean(log(1 + x))) # Same but only for column "LOAD" synthesize(mydata, log = list(fun = function(x) mean(log(1 + x)), only = "LOAD")) # Compute the proportion of time balance is positive synthesize(mydata, propPos = list(fun = function(x) mean(x > 0), only = "BALANCE")) # Compute 95% confidence interval for the marginal price synthesize(mydata, l = list(fun = "q2.5", only = "MRG. PRICE"), u = list(fun = "q97.5", only = "MRG. PRICE")) ## End(Not run)
## Not run: mydata <- readAntares("all", timeStep = "annual") synthesize(mydata) # Add minimum and maximum for all variables synthesize(mydata, "min", "max") # Compute a custom statistic for all columns synthesize(mydata, log = function(x) mean(log(1 + x))) # Same but only for column "LOAD" synthesize(mydata, log = list(fun = function(x) mean(log(1 + x)), only = "LOAD")) # Compute the proportion of time balance is positive synthesize(mydata, propPos = list(fun = function(x) mean(x > 0), only = "BALANCE")) # Compute 95% confidence interval for the marginal price synthesize(mydata, l = list(fun = "q2.5", only = "MRG. PRICE"), u = list(fun = "q97.5", only = "MRG. PRICE")) ## End(Not run)
compute thermal capacities from study
thermalGroupCapacities(opts = simOptions())
thermalGroupCapacities(opts = simOptions())
opts |
|