Editing physical data
In this tutorial, it is described how to edit the physical configuration of an existing case in IARA - for example, data related to generation units or network elements. For that, we will use as a starting point the example case boto_base_01
, analyzed in the first steps tutorial, and manipulate it, aiming to illustrate the incorporation of modifications to its dataset.
If you have already gone through the previous tutorial, this case was built in the case_path
defined. In order to manipulate its inputs, we will now load the boto_base_01
example case, with the IARA.load_study
function, and store it in a variable named case_edit_unit
. Note that we need to include the read_only = false
argument to indicate that we wish to write modifications to the case.
case_name = "boto_base_01"
case_edit_unit = IARA.load_study(case_path; read_only = false);
PSRClassesInterface.PSRDatabaseSQLite.DatabaseSQLite(SQLite.DB("/home/runner/work/IARA.jl/IARA.jl/docs/build/tutorial/data/ExampleCase_boto_base_01/study.iara"), "/home/runner/work/IARA.jl/IARA.jl/docs/build/tutorial/data/ExampleCase_boto_base_01/study.iara", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.Collection}("Configuration" => PSRClassesInterface.PSRDatabaseSQLite.Collection("Configuration", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "Configuration", "Configuration"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, "\"Configuration\"", true, "Configuration", "Configuration"), "number_of_nodes" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("number_of_nodes", Int64, missing, false, "Configuration", "Configuration"), "number_of_subscenarios" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("number_of_subscenarios", Int64, 1, true, "Configuration", "Configuration"), "iteration_limit" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("iteration_limit", Int64, missing, false, "Configuration", "Configuration"), "initial_date_time" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("initial_date_time", String, "\"2024-01-01\"", true, "Configuration", "Configuration"), "time_series_step" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("time_series_step", Int64, 0, true, "Configuration", "Configuration"), "hydro_balance_subperiod_resolution" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("hydro_balance_subperiod_resolution", Int64, 0, false, "Configuration", "Configuration"), "loop_subperiods_for_thermal_constraints" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("loop_subperiods_for_thermal_constraints", Int64, missing, false, "Configuration", "Configuration"), "cycle_discount_rate" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("cycle_discount_rate", Float64, missing, true, "Configuration", "Configuration")…), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}("subperiod_duration_in_hours" => PSRClassesInterface.PSRDatabaseSQLite.VectorParameter{Float64}("subperiod_duration_in_hours", Float64, missing, false, "subperiod_duration", "Configuration", "Configuration_vector_subperiod_duration"), "expected_number_of_repeats_per_node" => PSRClassesInterface.PSRDatabaseSQLite.VectorParameter{Int64}("expected_number_of_repeats_per_node", Int64, missing, false, "expected_number_of_repeats_per_node", "Configuration", "Configuration_vector_expected_number_of_repeats_per_node")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}("hour_subperiod_map" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("hour_subperiod_map", String, missing, false, "Configuration", "Configuration_time_series_files"), "fcf_cuts" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("fcf_cuts", String, missing, false, "Configuration", "Configuration_time_series_files"))), "RenewableUnit" => PSRClassesInterface.PSRDatabaseSQLite.Collection("RenewableUnit", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "RenewableUnit", "RenewableUnit"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "RenewableUnit", "RenewableUnit"), "technology_type" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("technology_type", Int64, missing, false, "RenewableUnit", "RenewableUnit")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}("biddinggroup_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("biddinggroup_id", Int64, missing, false, "RenewableUnit", "BiddingGroup", "id", "RenewableUnit"), "bus_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("bus_id", Int64, missing, false, "RenewableUnit", "Bus", "id", "RenewableUnit")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}("existing" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Int64}("existing", Int64, missing, false, "parameters", "RenewableUnit", "RenewableUnit_time_series_parameters", ["date_time"], 1), "max_generation" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("max_generation", Float64, missing, false, "parameters", "RenewableUnit", "RenewableUnit_time_series_parameters", ["date_time"], 1), "om_cost" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("om_cost", Float64, missing, false, "parameters", "RenewableUnit", "RenewableUnit_time_series_parameters", ["date_time"], 1), "curtailment_cost" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("curtailment_cost", Float64, missing, false, "parameters", "RenewableUnit", "RenewableUnit_time_series_parameters", ["date_time"], 1)), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}("generation_ex_ante" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("generation_ex_ante", String, missing, false, "RenewableUnit", "RenewableUnit_time_series_files"), "generation_ex_post" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("generation_ex_post", String, missing, false, "RenewableUnit", "RenewableUnit_time_series_files"))), "HydroUnit" => PSRClassesInterface.PSRDatabaseSQLite.Collection("HydroUnit", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "HydroUnit", "HydroUnit"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "HydroUnit", "HydroUnit"), "initial_volume" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("initial_volume", Float64, missing, false, "HydroUnit", "HydroUnit"), "initial_volume_type" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("initial_volume_type", Int64, 2, false, "HydroUnit", "HydroUnit"), "has_commitment" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("has_commitment", Int64, 0, false, "HydroUnit", "HydroUnit"), "operation_type" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("operation_type", Int64, 0, false, "HydroUnit", "HydroUnit")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}("hydrounit_spill_to" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("hydrounit_spill_to", Int64, missing, false, "HydroUnit", "HydroUnit", "spill_to", "HydroUnit"), "hydrounit_turbine_to" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("hydrounit_turbine_to", Int64, missing, false, "HydroUnit", "HydroUnit", "turbine_to", "HydroUnit"), "gaugingstation_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("gaugingstation_id", Int64, missing, false, "HydroUnit", "GaugingStation", "id", "HydroUnit"), "biddinggroup_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("biddinggroup_id", Int64, missing, false, "HydroUnit", "BiddingGroup", "id", "HydroUnit"), "bus_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("bus_id", Int64, missing, false, "HydroUnit", "Bus", "id", "HydroUnit")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}("waveguide_volume" => PSRClassesInterface.PSRDatabaseSQLite.VectorParameter{Float64}("waveguide_volume", Float64, missing, true, "waveguide", "HydroUnit", "HydroUnit_vector_waveguide")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}("existing" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Int64}("existing", Int64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1), "production_factor" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("production_factor", Float64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1), "min_generation" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("min_generation", Float64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1), "max_generation" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("max_generation", Float64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1), "max_turbining" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("max_turbining", Float64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1), "min_volume" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("min_volume", Float64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1), "max_volume" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("max_volume", Float64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1), "min_outflow" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("min_outflow", Float64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1), "om_cost" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("om_cost", Float64, missing, false, "parameters", "HydroUnit", "HydroUnit_time_series_parameters", ["date_time"], 1)), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}("inflow_ex_ante" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("inflow_ex_ante", String, missing, false, "HydroUnit", "HydroUnit_time_series_files"), "inflow_ex_post" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("inflow_ex_post", String, missing, false, "HydroUnit", "HydroUnit_time_series_files"))), "GaugingStation" => PSRClassesInterface.PSRDatabaseSQLite.Collection("GaugingStation", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "GaugingStation", "GaugingStation"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "GaugingStation", "GaugingStation")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}("gaugingstation_downstream" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("gaugingstation_downstream", Int64, missing, false, "GaugingStation", "GaugingStation", "downstream", "GaugingStation")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}("historical_inflow" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("historical_inflow", Float64, missing, false, "historical_inflow", "GaugingStation", "GaugingStation_time_series_historical_inflow", ["date_time"], 1)), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}()), "ThermalUnit" => PSRClassesInterface.PSRDatabaseSQLite.Collection("ThermalUnit", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "ThermalUnit", "ThermalUnit"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "ThermalUnit", "ThermalUnit"), "has_commitment" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("has_commitment", Int64, 0, true, "ThermalUnit", "ThermalUnit"), "max_ramp_up" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("max_ramp_up", Float64, missing, false, "ThermalUnit", "ThermalUnit"), "max_ramp_down" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("max_ramp_down", Float64, missing, false, "ThermalUnit", "ThermalUnit"), "min_uptime" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("min_uptime", Float64, missing, false, "ThermalUnit", "ThermalUnit"), "max_uptime" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("max_uptime", Float64, missing, false, "ThermalUnit", "ThermalUnit"), "min_downtime" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("min_downtime", Float64, missing, false, "ThermalUnit", "ThermalUnit"), "max_startups" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("max_startups", Int64, missing, false, "ThermalUnit", "ThermalUnit"), "max_shutdowns" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("max_shutdowns", Int64, missing, false, "ThermalUnit", "ThermalUnit")…), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}("biddinggroup_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("biddinggroup_id", Int64, missing, false, "ThermalUnit", "BiddingGroup", "id", "ThermalUnit"), "bus_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("bus_id", Int64, missing, false, "ThermalUnit", "Bus", "id", "ThermalUnit")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}("existing" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Int64}("existing", Int64, missing, false, "parameters", "ThermalUnit", "ThermalUnit_time_series_parameters", ["date_time"], 1), "startup_cost" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("startup_cost", Float64, missing, false, "parameters", "ThermalUnit", "ThermalUnit_time_series_parameters", ["date_time"], 1), "min_generation" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("min_generation", Float64, missing, false, "parameters", "ThermalUnit", "ThermalUnit_time_series_parameters", ["date_time"], 1), "max_generation" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("max_generation", Float64, missing, false, "parameters", "ThermalUnit", "ThermalUnit_time_series_parameters", ["date_time"], 1), "om_cost" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("om_cost", Float64, missing, false, "parameters", "ThermalUnit", "ThermalUnit_time_series_parameters", ["date_time"], 1)), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}()), "DemandUnit" => PSRClassesInterface.PSRDatabaseSQLite.Collection("DemandUnit", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "DemandUnit", "DemandUnit"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "DemandUnit", "DemandUnit"), "demand_unit_type" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("demand_unit_type", Int64, 0, true, "DemandUnit", "DemandUnit"), "max_shift_up" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("max_shift_up", Float64, missing, false, "DemandUnit", "DemandUnit"), "max_shift_down" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("max_shift_down", Float64, missing, false, "DemandUnit", "DemandUnit"), "curtailment_cost" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("curtailment_cost", Float64, missing, false, "DemandUnit", "DemandUnit"), "max_curtailment" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("max_curtailment", Float64, missing, false, "DemandUnit", "DemandUnit"), "max_demand" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("max_demand", Float64, missing, true, "DemandUnit", "DemandUnit")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}("bus_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("bus_id", Int64, missing, false, "DemandUnit", "Bus", "id", "DemandUnit")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}("existing" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Int64}("existing", Int64, missing, false, "parameters", "DemandUnit", "DemandUnit_time_series_parameters", ["date_time"], 1)), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}("elastic_demand_price" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("elastic_demand_price", String, missing, false, "DemandUnit", "DemandUnit_time_series_files"), "demand_window" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("demand_window", String, missing, false, "DemandUnit", "DemandUnit_time_series_files"), "demand_ex_ante" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("demand_ex_ante", String, missing, false, "DemandUnit", "DemandUnit_time_series_files"), "demand_ex_post" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile{String}("demand_ex_post", String, missing, false, "DemandUnit", "DemandUnit_time_series_files"))), "Zone" => PSRClassesInterface.PSRDatabaseSQLite.Collection("Zone", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "Zone", "Zone"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "Zone", "Zone")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}()), "Bus" => PSRClassesInterface.PSRDatabaseSQLite.Collection("Bus", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "Bus", "Bus"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "Bus", "Bus"), "latitude" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("latitude", Float64, missing, false, "Bus", "Bus"), "longitude" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Float64}("longitude", Float64, missing, false, "Bus", "Bus")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}("zone_id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("zone_id", Int64, missing, false, "Bus", "Zone", "id", "Bus")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}()), "DCLine" => PSRClassesInterface.PSRDatabaseSQLite.Collection("DCLine", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "DCLine", "DCLine"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "DCLine", "DCLine")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}("bus_from" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("bus_from", Int64, missing, false, "DCLine", "Bus", "from", "DCLine"), "bus_to" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("bus_to", Int64, missing, false, "DCLine", "Bus", "to", "DCLine")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}("existing" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Int64}("existing", Int64, missing, false, "parameters", "DCLine", "DCLine_time_series_parameters", ["date_time"], 1), "capacity_to" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("capacity_to", Float64, missing, false, "parameters", "DCLine", "DCLine_time_series_parameters", ["date_time"], 1), "capacity_from" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("capacity_from", Float64, missing, false, "parameters", "DCLine", "DCLine_time_series_parameters", ["date_time"], 1)), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}()), "Branch" => PSRClassesInterface.PSRDatabaseSQLite.Collection("Branch", OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter}("id" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("id", Int64, missing, false, "Branch", "Branch"), "label" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{String}("label", String, missing, true, "Branch", "Branch"), "line_model" => PSRClassesInterface.PSRDatabaseSQLite.ScalarParameter{Int64}("line_model", Int64, 0, true, "Branch", "Branch")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation}("bus_from" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("bus_from", Int64, missing, false, "Branch", "Bus", "from", "Branch"), "bus_to" => PSRClassesInterface.PSRDatabaseSQLite.ScalarRelation{Int64}("bus_to", Int64, missing, false, "Branch", "Bus", "to", "Branch")), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorParameter}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.VectorRelation}(), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeries}("existing" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Int64}("existing", Int64, missing, false, "parameters", "Branch", "Branch_time_series_parameters", ["date_time"], 1), "capacity" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("capacity", Float64, missing, false, "parameters", "Branch", "Branch_time_series_parameters", ["date_time"], 1), "reactance" => PSRClassesInterface.PSRDatabaseSQLite.TimeSeries{Float64}("reactance", Float64, missing, false, "parameters", "Branch", "Branch_time_series_parameters", ["date_time"], 1)), OrderedCollections.OrderedDict{String, PSRClassesInterface.PSRDatabaseSQLite.TimeSeriesFile}())…), false, PSRClassesInterface.PSRDatabaseSQLite.TimeController(Dict{Tuple{String, String}, PSRClassesInterface.PSRDatabaseSQLite.TimeControllerCache}(), Dict{String, Bool}()))
Now, we can modify any case characteristic, from general characteristics (such as number of periods or number of scenarios) to market clearing aspects. In the present tutorial, we will focus on editing physical elements, which can be added, removed or have their parameters modified. To illustrate this functionality, we can, for example, add a new thermal generator to our example case, using the function IARA.add_thermal_unit!
, as shown below. Note that the functions related to other physical elements of the system are analogous to the one used in this example - for instance, IARA.add_renewable_unit!
adds a new renewable generator and IARA.add_bus!
adds a new bus.
Regardless of the element type, additions require the definition of a set of parameters. In the case of thermal units, as shown below, the information needed comprises: (i) the case that is being modified (see above that we have store our example case in a variable named case_edit_unit
), (ii) the label
, which corresponds to the plant's name, (iii) technical characteristics, such as the generation capacity (max_generation
), (iv) variable costs (om_cost
), (v) the bus to which it is connected (bus_id
), and the bidding group to which it is assigned (biddinggroup_id
) - for more information on Bidding groups, read about the model's key features.
Note that IARA.add_thermal_unit!
uses the functions DataFrame
and DateTime
, which belong to the DataFrames
and Dates
packages, respectively, which must be installed. Then, we just need to import them before calling IARA.add_thermal_unit!
, as shown below.
using DataFrames
using Dates
IARA.add_thermal_unit!(
case_edit_unit;
label = "Geothermal",
parameters = DataFrame(;
date_time = [DateTime(0)],
existing = [1],
max_generation = [20.0],
om_cost = [3.0],
),
biddinggroup_id = "ThermalA_01",
bus_id = "Eastern",
)
As mentioned, other general or physical modifications can be carried out, using functions similar to the ones presented above. For now, let's move forward with the example case incorporating the addition presented in this tutorial. The final step is to close the study, using the IARA.close_study!
function, assign a new folder for the model to write execution outputs and re-execute it, using the function IARA.market_clearing
.
IARA.close_study!(case_edit_unit)
path02_edit_unit = joinpath(case_path, "02_edit_unit")
IARA.market_clearing(
case_path;
output_path = path02_edit_unit,
delete_output_folder_before_execution = true,
);
[ Info: IARA - version: x.x.x
[ Info:
[ Info: Execution options
[ Info: Path: /home/runner/work/IARA.jl/IARA.jl/docs/build/tutorial/data/ExampleCase_boto_base_01
[ Info: Output path: /home/runner/work/IARA.jl/IARA.jl/docs/build/tutorial/data/ExampleCase_boto_base_01/02_edit_unit
[ Info: Run mode: MARKET_CLEARING
[ Info: Plot results: true
[ Info: periods: 6
[ Info: scenarios: 3
[ Info: subperiods: 3
[ Info:
[ Info: Market Clearing Subproblems:
[ Info:
[ Info: Subproblem Execution Mode Integer Variables
[ Info: EX_ANTE_PHYSICAL SKIP CALCULATE_NORMALLY
[ Info: EX_ANTE_COMMERCIAL SKIP CALCULATE_NORMALLY
[ Info: EX_POST_PHYSICAL COST_BASED CALCULATE_NORMALLY
[ Info: EX_POST_COMMERCIAL SKIP CALCULATE_NORMALLY
[ Info:
[ Info: Collections
[ Info: RenewableUnit: 1 element(s)
[ Info: HydroUnit: 2 element(s)
[ Info: ThermalUnit: 7 element(s)
[ Info: Zone: 1 element(s)
[ Info: Bus: 2 element(s)
[ Info: DemandUnit: 3 element(s)
[ Info: DCLine: 1 element(s)
[ Info: AssetOwner: 6 element(s)
[ Info: GaugingStation: 2 element(s)
[ Info: BiddingGroup: 7 element(s)
[ Info:
[ Info: Time Series from external files
[ Info: inflow
[ Info: demand
[ Info: renewable_generation
[ Info:
[ Info: Cuts file:
[ Info: No cuts file
[ Info:
[ Info: Running clearing for period: 1
[ Info: Running simulation EX_POST_PHYSICAL
[ Info: Running clearing for period: 2
[ Info: Running simulation EX_POST_PHYSICAL
[ Info: Running clearing for period: 3
[ Info: Running simulation EX_POST_PHYSICAL
[ Info: Running clearing for period: 4
[ Info: Running simulation EX_POST_PHYSICAL
[ Info: Running clearing for period: 5
[ Info: Running simulation EX_POST_PHYSICAL
[ Info: Running clearing for period: 6
[ Info: Running simulation EX_POST_PHYSICAL
[ Info: Running post-processing routines
[ Info: Building plots
After successfully re-executing IARA, the outputh path will be filled with files containing the model's results, including automatically generated plots. When analyzing the new marginal costs obtained, using the function IARA.custom_plot
(which uses the output file load_marginal_cost_ex_post_physical.csv
), we can see that they present differences in comparison with the ones observed in the previous execution, prior to the addition of the new thermal plant. In particular, since we have added to the Eastern bus a new low-cost generation asset, it is visible the consequent reduction in the marginal costs in this bus.
cmg_name2 = "load_marginal_cost_ex_post_physical.csv"
cmg_path2 = joinpath(path02_edit_unit, cmg_name2)
IARA.custom_plot(cmg_path2, IARA.PlotTimeSeriesMean)
Moving forward with the sequence of tutorial, click here to understand how to modify market clearing configurations in an existing case.
This page was generated using Literate.jl.