Skip to content
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

751-add-reserves-tutorial #756

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e7a6a63
Introduce window_sum_duration to use within min_res_gen_to_demand_ratio
manuelma Sep 18, 2023
6a9931a
add tutorial file with general structure
datejada Sep 22, 2023
c354e63
Resolve name conflict, but other issues remain.
Tasqu Sep 25, 2023
7a7d3c4
Fix mystery error by rearranging terms?
Tasqu Sep 25, 2023
9f70c7a
Merge branch 'master' into window_sum_duration
manuelma Sep 25, 2023
2b25835
Merge branch 'master' of https://github.com/Spine-project/SpineOpt.jl…
DillonJ Sep 25, 2023
b1d7e09
Fix units availability constraint unit test?
Tasqu Sep 25, 2023
6107515
Report solution from the Benders master problem too
manuelma Sep 26, 2023
8441a9c
Merge branch 'window_sum_duration' of https://github.com/Spine-projec…
DillonJ Sep 26, 2023
ec9451f
Fix post processing results
manuelma Sep 26, 2023
67d9a4b
Add tests for skipping duals calculation if no integers
manuelma Sep 26, 2023
f580048
First changes in the reserve definition steps in the tutorial
datejada Sep 26, 2023
ff9cf40
Got rid of weighting from sp_unit flow
DillonJ Sep 26, 2023
ec54752
Merge branch 'window_sum_duration' of https://github.com/Spine-projec…
DillonJ Sep 26, 2023
a63a201
Introduce sp_windows to advance work in mp-min-res-gen constraint
manuelma Sep 27, 2023
4514909
Fix tests
manuelma Sep 27, 2023
dc51234
Fix sp_windows
manuelma Sep 27, 2023
de1eca4
Introduce benders_starting_{units/connections/storages}_invested
manuelma Sep 27, 2023
11de5c6
Introduce min_iterations
manuelma Sep 27, 2023
737ba95
Fix docs to work with latest Documenter.jl
manuelma Sep 28, 2023
06d7994
Merge pull request #753 from spine-tools/#745-JuMP-compat
Tasqu Sep 28, 2023
3909a78
.gitignore Manifests
Tasqu Sep 28, 2023
765d1d1
Increment HTML size threshold
manuelma Sep 28, 2023
72b557e
Bump version
Tasqu Sep 28, 2023
c8dee82
Merge pull request #758 from spine-tools/fix_docs
manuelma Sep 28, 2023
21aad84
Introduce equal_investments and min_max_entities_invested_available
manuelma Sep 28, 2023
730639d
Implement min_max_capacity_invested_available for investment groups
manuelma Sep 28, 2023
a3cb092
Merge pull request #761 from spine-tools/investment_groups_extended_f…
manuelma Sep 28, 2023
2a0e467
Second set of changes to the reserve tutorial
datejada Sep 29, 2023
9fcb033
Trird set of changes to the reserve tutorial
datejada Sep 29, 2023
7ecc962
Add png files and links to them in the tutorial
datejada Oct 2, 2023
015f64d
add tutorial file with general structure
datejada Sep 22, 2023
e3ac5a4
First changes in the reserve definition steps in the tutorial
datejada Sep 26, 2023
d1ad67d
Second set of changes to the reserve tutorial
datejada Sep 29, 2023
15fbc91
Trird set of changes to the reserve tutorial
datejada Sep 29, 2023
2ae6eb5
Add png files and links to them in the tutorial
datejada Oct 2, 2023
4d0646b
Merge branch '751-add-reserves-tutorial' of https://github.com/spine-…
datejada Oct 2, 2023
3580bfa
minor changes (spelling and figure locations)
Oct 9, 2023
c58b541
Improve the instructions to open the Desing View
datejada Oct 10, 2023
07bf8df
Update reserves.md
datejada Oct 16, 2023
239f358
Extend the introduction
datejada Oct 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ docs/src/concept_reference/relationship_classes.md
docs/src/concept_reference/Object Classes.md
docs/src/concept_reference/Parameter Value Lists.md
docs/src/concept_reference/Relationship Classes.md
test/Manifest.toml
Manifest.toml
5 changes: 2 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SpineOpt"
uuid = "0d8fc150-4032-4b6e-9540-20efcb304861"
authors = ["Spine Project consortium <[email protected]>"]
version = "0.6.15"
version = "0.6.16"

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
Expand All @@ -17,6 +17,5 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SpineInterface = "0cda1612-498a-11e9-3c92-77fa82595a4f"

[compat]
SpineInterface = "0.11.6"
SpineInterface = "0.11.9"
julia = "^1.2"
JuMP = "< 1.14"
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ SpineOpt.populate_empty_chapters!(pages, joinpath(path, "src"))
# Create and deploy the documentation
makedocs(
sitename="SpineOpt.jl",
format=Documenter.HTML(prettyurls=get(ENV, "CI", nothing) == "true"), # uncomment to deploy locally
format=Documenter.HTML(prettyurls=get(ENV, "CI", nothing) == "true", size_threshold=409600), # uncomment to deploy locally
pages=pages,
warnonly=true
)
deploydocs(repo="github.com/spine-tools/SpineOpt.jl.git", versions=["stable" => "v^", "v#.#"])
60 changes: 30 additions & 30 deletions docs/src/tutorial/case_study_a5.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ power station in the river is modelled using the following elements:
Below is a schematic of the model. For clarity, only the Rebnis station
is presented in full detail:

![image](../figs_a5/case_study_a5_schematic.png)
![image](figs_a5/case_study_a5_schematic.png)

In order to run this tutorial you must first execute some preliminary
steps from the [Simple System](../../simple_system/) tutorial.
steps from the [Simple System](simple_system.md) tutorial.
Specifically, execute all steps from the
[guide](../../simple_system/index.html#guide), up to and including the step of
[importing the spineopt database template](../../simple_system/index.html#importing-the-spineopt-database-template).
[guide](simple_system.md#guide), up to and including the step of
[importing the spineopt database template](simple_system.md#importing-the-spineopt-database-template).
It is advisable to go through the whole tutorial in order to familiarise
yourself with Spine.

Expand All @@ -85,10 +85,10 @@ yourself with Spine.

### Importing the SpineOpt database template

- Download [the SpineOpt database template](../../../templates/spineopt_template.json) (right click on the link, then select *Save link as...*)
- Download [the SpineOpt database template](https://raw.githubusercontent.com/spine-tools/SpineOpt.jl/master/templates/spineopt_template.json) (right click on the link, then select *Save link as...*)
- Select the *input* Data Store item in the *Design View*.
- Go to *Data Store Properties* and hit **Open editor**. This will open the newly created database in the *Spine DB Editor*, looking similar to image below.
![image](../figs_a5/case_study_a5_spine_db_editor_empty.png)
![image](figs_a5/case_study_a5_spine_db_editor_empty.png)
!!! note
The Spine DB editor is a dedicated interface within Spine Toolbox for visualizing and managing Spine databases.
- Press **Alt + F** to display the editor menu, select **File -> Import...**,
Expand Down Expand Up @@ -116,7 +116,7 @@ yourself with Spine.

There are two options in this tutorial to enter data in the Database.
The first one is to enter data manually and the second to
[use the importer](../index.html#Using-the-Importer) functionality. These are described in the
[use the importer](../index.md#Using-the-Importer) functionality. These are described in the
next two subsections respectively and produce similar models. The model
created when using the importer creates a model with two-segments
efficiency curves for converting water to electricity (while the model
Expand Down Expand Up @@ -147,7 +147,7 @@ yourself with Spine.
Kvistforsen_pwr_plant
- Go to *Object tree* (on the top left of the window, usually), right-click on `unit` and select **Add objects** from the context menu. This will open the *Add objects* dialog.
- Select the first cell under the **object name** column and press **Ctrl+V**. This will paste the list of plant names from the clipboard into that column; the **object class name** column will be filled automatically with ‘unit‘. The form should now be looking similar to this:
![image](../figs_a5/add_power_plant_units.png)
![image](figs_a5/add_power_plant_units.png)
- Click **Ok**.
- Back in the *Spine DB Editor*, under *Object tree*, double click on `unit` to confirm that the objects are effectively there.
- Commit changes with the message ‘Add power plants’.
Expand Down Expand Up @@ -240,16 +240,16 @@ yourself with Spine.
- To specify the general behaviour of our model, stay in the *Spine DB
Editor* and enter model parameter values as follows:
- Select the model parameter value data (i.e. select all, **Ctrl+A**) from the file below and copy it to the clipboard (**Ctrl+C**):
[cs-a5-model-parameter-values.txt](../../data/cs-a5-model-parameter-values.txt)
[cs-a5-model-parameter-values.txt](data/cs-a5-model-parameter-values.txt)
- Select `instance` in the *Object tree* and inspect the table in *Object parameter value* (on the top-center of the window, usually). Make sure that the columns in the table are ordered as follows (drag and drop columns if you need to change their order):

object_class_name | object_name | parameter_name | alternative_name | value | database
- Select the first cell under `object_class_name` and press **Ctrl+V**. This will paste the model parameter value data from the clipboard into the table. The form should be looking like this:
![image](../figs_a5/case_study_a5_model_parameters.png)
![image](figs_a5/case_study_a5_model_parameters.png)

- Specify the resolution of our temporal block `some_week` in the same
way using the data below:
[cs-a5-temporal_block-parameter-values.txt](../../data/cs-a5-temporal_block-parameter-values.txt)
[cs-a5-temporal_block-parameter-values.txt](data/cs-a5-temporal_block-parameter-values.txt)

- Specify the behaviour of all system nodes with the data below, where:
- `demand` represents the local inflow (negative in most cases).
Expand All @@ -261,7 +261,7 @@ yourself with Spine.
that there aren't any loses).
- `node_state_cap` is the maximum level of the reservoirs.
To do this in one single step, simply select `node` in the *Object tree* and paste the following values in the first empty cell:
[cs-a5-node-parameter-values.txt](../../data/cs-a5-node-parameter-values.txt)
[cs-a5-node-parameter-values.txt](data/cs-a5-node-parameter-values.txt)

#### Establishing relationships

Expand All @@ -275,7 +275,7 @@ yourself with Spine.
common electricity node. Both the power plants and the electricity
load belong to the class `unit`.
- Select the list of unit and node names from below and copy it to the clipboard (**Ctrl+C**).
[cs-a5-unit__from_node.txt](../../data/cs-a5-unit__from_node.txt)
[cs-a5-unit__from_node.txt](data/cs-a5-unit__from_node.txt)
- In the *Spine DB Editor*, go to *Relationship tree* (on the
bottom left of the window, usually), right-click on
`unit__from_node` and select **Add relationships** from the
Expand All @@ -284,7 +284,7 @@ yourself with Spine.
**Ctrl+V**. This will paste the list of plant and node names
from the clipboard into the table. The form should be looking
like this:
![image](../figs_a5/add_pwr_plant_water_from_node.png)
![image](figs_a5/add_pwr_plant_water_from_node.png)
- Click **Ok**.
- Back in the *Spine DB Editor*, under *Relationship tree*, double
click on `unit__from_node` to confirm that the relationships are
Expand All @@ -297,7 +297,7 @@ yourself with Spine.
a power plant releases water to the station's lower water node, and
that the power plants supply electricity to the common electricity
node. Use the following data and do as before:
[cs-a5-unit__to_node.txt](../../data/cs-a5-unit__to_node.txt)
[cs-a5-unit__to_node.txt](data/cs-a5-unit__to_node.txt)

!!! note
At this point, you might be wondering what's the purpose of the
Expand All @@ -315,13 +315,13 @@ yourself with Spine.
discharged, it is taken from the *lower* water node of the station,
if spilled it is taken from the *upper* water node of the station.
Use the following data and do as before:
[cs-a5-connection__from_node.txt](../../data/cs-a5-connection__from_node.txt)
[cs-a5-connection__from_node.txt](data/cs-a5-connection__from_node.txt)

- Create relationships of the class `connection__to_node` to represent
that both discharge and spill are released into the *upper* node of
the next downstream station. Use the following data and do as
before:
[cs-a5-connection__to_node.txt](../../data/cs-a5-connection__to_node.txt)
[cs-a5-connection__to_node.txt](data/cs-a5-connection__to_node.txt)

!!! note
At this point, you might be wondering what's the purpose of the
Expand All @@ -338,7 +338,7 @@ yourself with Spine.
water, for electricity nodes with respect to electricity. This way,
you link all nodes to either the commocity `water` or the commodity
`electricity`. Use the following data and do as before:
[cs-a5-node__commodity.txt](../../data/cs-a5-node__commodity.txt)
[cs-a5-node__commodity.txt](data/cs-a5-node__commodity.txt)

- Define that all nodes in our model have to be balanced at each time
step. To do this, you create a relationship of the class
Expand All @@ -363,20 +363,20 @@ yourself with Spine.

- Finally, the values of all parameters have to be entered. Specify the capacity of all hydropower plants, and
their respective variable operating cost by entering `unit__from_node` parameter values as follows:
- Select the data from the text-box below and copy it to the clipboard (**Ctrl+C**): [cs-a5-unit__from_node-relationship-parameter-values.txt](../../data/cs-a5-unit__from_node-relationship-parameter-values.txt)
- Select the data from the text-box below and copy it to the clipboard (**Ctrl+C**): [cs-a5-unit__from_node-relationship-parameter-values.txt](data/cs-a5-unit__from_node-relationship-parameter-values.txt)
- In the *Spine DB Editor*, go to *Relationship tree* (on the bottom left of the window, usually), and click on `unit__from_node`. Then, go to *Relationship parameter value* (on the bottom-center of the window, usually). Make sure that the columns in the table are ordered as follows (drag and drop columns if you need to change their order):

relationship_class_name | object_name_list | parameter_name | alternative_name | value | database
- Select the first cell under `relationship_class_name` and press **Ctrl+V**. This will paste the parameter value data from the clipboard into the table.

- Specify the conversion ratio between discharged water and generated electricity for each hydropower station as well as a similar conversion rate (set to 1) to represent that water cannot be lost between upper and lower water nodes. Use the following data to enter the parameter values `unit__from_node`:
[cs-a5-unit\_\_node\_\_node-relationship-parameter-values.txt](../../data/cs-a5-unit__node__node-relationship-parameter-values.txt)
[cs-a5-unit\_\_node\_\_node-relationship-parameter-values.txt](data/cs-a5-unit__node__node-relationship-parameter-values.txt)

- Specify the average discharge and spillage in the first hours of the simulation. Use the following data to enter the parameter values `connection__from_node`:
[cs-a5-connection__from_node-relationship-parameter-values.txt](../../data/cs-a5-connection__from_node-relationship-parameter-values.txt)
[cs-a5-connection__from_node-relationship-parameter-values.txt](data/cs-a5-connection__from_node-relationship-parameter-values.txt)

- Finally, specify the delay (the time it takes for the water to run between water nodes) and the transfer ratio (being equal to 1) of different water connections. Use the following data to enter the parameter values `connection__node_node`:
[cs-a5-connection\_\_node\_\_node-relationship-parameter-values.txt](../../data/cs-a5-connection__node__node-relationship-parameter-values.txt)
[cs-a5-connection\_\_node\_\_node-relationship-parameter-values.txt](data/cs-a5-connection__node__node-relationship-parameter-values.txt)

- When you're ready, commit all changes to the database via the main
menu (**Alt + F**).
Expand All @@ -385,7 +385,7 @@ yourself with Spine.

#### Additional Steps for Project Setup

- Drag the Data Connection icon ![image](../figs_a5/file-alt.png) from the tool bar and drop it into the
- Drag the Data Connection icon ![image](figs_a5/file-alt.png) from the tool bar and drop it into the
Design View. This will open the *Add Data connection dialogue*. Type
in ‘Data Connection’ and click on **Ok**.
- To import the model into the Spine database, you need to create an
Expand All @@ -395,21 +395,21 @@ yourself with Spine.
will pop-up.
- Type ‘Import Model’ as the name of the specification. Save the
specification by using **Ctrl+S** and close the window.
- Drag the newly created Import Model Importer item icon ![image](../figs_a5/database-import.png)
- Drag the newly created Import Model Importer item icon ![image](figs_a5/database-import.png)
from the tool bar and drop it into
the *Design View*. This will open the Add Importer dialogue. Type in
‘Import Model’ and click on **Ok**.
- Connect ‘Data Connection’ with ‘Import Model’ by first clicking on
one of the Data Connection’s connectors and then on one of the
Importer’s connectors. Connect similarly the importer with the input
database. Now the project should look similar to this:
![image](../figs_a5/items_connections.png)
![image](figs_a5/items_connections.png)
- From the main menu, select **File -> Save project**.

#### Importing the model

- Download [the data](../../data/a5.xlsx)
and [the accompanying mapping](../../data/A5_importer_specification.json)
- Download [the data](data/a5.xlsx)
and [the accompanying mapping](data/A5_importer_specification.json)
(right click on the links, then select *Save link as...*).
- Add a reference to the file containing the model.
- Select the *Data Connection item* in the *Design View* to show the *Data Connection properties* window (on the right side of the window usually).
Expand All @@ -419,7 +419,7 @@ yourself with Spine.
## Executing the workflow

Once the workflow is defined and input data is in place, the project is
ready to be executed. Hit the **Execute project** button ![image](../figs_a5/play-circle.png)
ready to be executed. Hit the **Execute project** button ![image](figs_a5/play-circle.png)
on the tool bar.

You should see ‘Executing All Directed Acyclic Graphs’ printed in the
Expand All @@ -432,7 +432,7 @@ is complete.

Select the output data store and open the Spine DB editor.

![image](../figs_a5/case_study_a5_output.png)
![image](figs_a5/case_study_a5_output.png)


To checkout the flow on the electricity load (i.e., the total
Expand All @@ -443,7 +443,7 @@ double-click the first cell under `value`.
The *Parameter value editor* will pop up. You should see something like
this:

![image](../figs_a5/case_study_a5_output_electricity_load_unit_flow.png)
![image](figs_a5/case_study_a5_output_electricity_load_unit_flow.png)


!!! note
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading