if (FALSE) {
# list for cluster parameters :
storage_values_default()
# create a cluster by default (with default parameters values + default data values):
createClusterST(area = "my_area",
"my_cluster")
# Read cluster in study
# by default, cluster name is prefixed
# by the area name
levels(readClusterSTDesc()$cluster)
# > "my_area_my_cluster"
# create cluster with custom parameter and data
# use the function to create your own list of parameters (no Antares optim)
# if you want optim (my_parameters$initialleveloptim <- TRUE)
my_parameters <- storage_values_default()
my_parameters$efficiency <- 0.5
my_parameters$initiallevel <- 10
my_parameters$withdrawalnominalcapacity <- 100
my_parameters$injectionnominalcapacity <- 1000
my_parameters$reservoircapacity <- 10000
# time series
inflow_data <- matrix(3, 8760)
ratio_data <- matrix(0.7, 8760)
createClusterST(area = "my_area",
"my_cluster",
storage_parameters = my_parameters,
PMAX_withdrawal = ratio_data,
inflows = inflow_data,
PMAX_injection = ratio_data,
lower_rule_curve = ratio_data,
upper_rule_curve = ratio_data)
# for a study version >= 9.2 (new parameters)
my_parameters <- storage_values_default()
my_parameters$efficiencywithdrawal <- 0.5
my_parameters$`penalize-variation-injection` <- TRUE
my_parameters$`penalize-variation-withdrawal` <- TRUE
createClusterST(area = "my_area",
"my_cluster",
storage_parameters = my_parameters)
# time series
ratio_value <- matrix(0.7, 8760)
# default properties with new optional TS
createClusterST(area = "fr",
cluster_name = "good_ts_value",
cost_injection = ratio_value,
cost_withdrawal = ratio_value,
cost_level = ratio_value,
cost_variation_injection = ratio_value,
cost_variation_withdrawal = ratio_value)
# Add optional constraints properties
name_no_prefix <- "add_constraints"
constraints_properties <- list(
"withdrawal-1"=list(
variable = "withdrawal",
operator = "equal",
hours = c("[1,3,5]",
"[120,121,122,123,124,125,126,127,128]")
),
"netting-1"=list(
variable = "netting",
operator = "less",
hours = c("[1, 168]")
))
# create a cluster with constraint properties (no need to provide TS)
createClusterST(area = area_test_clust,
cluster_name = name_no_prefix,
constraints_properties = constraints_properties)
# Add optional constraints properties + TS
constraints_properties <- list(
"withdrawal-2"=list(
variable = "withdrawal",
operator = "equal",
hours = c("[1,3,5]",
"[120,121,122,123,124,125,126,127,128]")
),
"netting-2"=list(
variable = "netting",
operator = "less",
hours = c("[1, 168]")
))
good_ts <- matrix(0.7, 8760)
constraints_ts <- list(
"withdrawal-2"=good_ts,
"netting-2"=good_ts)
# create a cluster with constraint properties + TS
createClusterST(area = area_test_clust,
cluster_name = name_no_prefix,
constraints_properties = constraints_properties,
constraints_ts = constraints_ts)
}
Run the code above in your browser using DataLab