-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #435 from Spine-project/MGA_implementation
Mga implementation
- Loading branch information
Showing
44 changed files
with
1,180 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# [Modelling to generate alternatives](@id mga-advanced) | ||
|
||
Through modelling to generate alternatives (short MGA), near-optimal solutions can be explored under certain conditions. | ||
The idea is that an orginal problem is solved, and subsequently solved again under the condition that the realization of variables should be maximally different from the previous iteration(s), while keeping the objective function within a certain threshold (defined by [max\_mga\_slack](@ref)). | ||
|
||
In SpineOpt, we choose [units\_invested\_available](@ref), [connections\_invested\_available](@ref), and [storages\_invested\_available](@ref) as variables that can be considered for the maximum-difference-problem. The implementation is based on [Modelling to generate alternatives: A technique to explore uncertainty in energy-environment-economy models](https://doi.org/10.1016/j.apenergy.2017.03.065). | ||
|
||
## How to set up an MGA problem | ||
- [model](@ref): In order to explore an MGA model, you will need one model of type [spineopt\_mga](@ref model_type_list). You should also define the number of iterations ([max\_mga\_iterations](@ref), and the maximum allowed deviation from the original objective function ([max\_mga\_slack](@ref)). | ||
- at least one investment candidate of type [unit](@ref), [connection](@ref), or [node](@ref). For more details on how to set up an investment problem please see: [Investment Optimization](@ref). | ||
- To include the investment decisions in the MGA difference maximization, the parameter [units\_invested\_mga](@ref), [connections\_invested\_mga](@ref), or [storages\_invested\_mga](@ref) need to be set to true, respectively. | ||
- The original MGA formulation is non-convex (maximization problem of an absolute function), but has been linearized through big M method. For this purpose, one should always make sure that [units\_invested\_big\_m\_mga](@ref), [connections\_invested\_big\_m\_mga](@ref), or [storages\_invested\_big\_m\_mga](@ref), respectively, is sufficently large to always be larger the the maximum possible difference per MGA iteration. (Typically the number of candidates could suffice.) | ||
- As [output](@ref)s are used to intermediately store solutions from different MGA runs, it is important that `units_invested`, `connections_invested`, or `storages_invested`, respectively, are defined as [output](@ref) objects in your database. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The [connections\_invested\_big\_m\_mga](@ref) parameter is used in combination with the MGA algorithm (see [mga-advanced](@ref)). | ||
It defines an upper bound on the maximum difference between any MGA iteration. The big M should be chosen always sufficiently large. (Typically, a value equivalent to | ||
[candidate\_connections](@ref) could suffice.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The [connections\_invested\_mga](@ref) is a boolean parameter that can be used in combination with the MGA algorithm (see [mga-advanced](@ref)). As soon as | ||
the value of [connections\_invested\_mga](@ref) is set to `true`, investment decisions in this connection, or group of connections, will be included in the MGA algorithm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
When the [model](@ref) in question is of type `:spineopt_master`, this determines the maximum number of Benders iterations. | ||
When the [model](@ref) in question is of type `:spineopt_benders_master`, this determines the maximum number of Benders iterations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
In the MGA algorithm the original problem is reoptimized (see also [mga-advanced](@ref)), and finds near-optimal solutions. The parameter [max\_mga\_iterations](@ref) defines how many MGA iterations will be performed, i.e. how many near-optimal solutions will be generated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
In the MGA algorithm the original problem is reoptimized (see also [mga-advanced](@ref)), and finds near-optimal solutions. The parameter [max\_mga\_slack](@ref) defines how far from the optimum the new solutions can maximally be (e.g. a value of 0.05 would alow for a 5% increase of the orginal objective value). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Currently, the MGA algorithm (see [mga-advanced](@ref)) only supports absolute differences between MGA variables (e.g. absolute differences between [units\_invested\_available](@ref) etc.). Hence, the default for this parameter is `false` and should not be changed for now. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
This parameter is used, generally, to control [model](@ref) dependent functionality and specify [model](@ref)-level parameters for different [model](@ref)s. Currently, the main use is to identify the [model](@ref) objects that represent the master and operational sub problems within a decomposed investment problem structure. To trigger the decomposed structure, a [model](@ref) object with `model_type`=`:spineopt_master` must exist and another with `model_type`=`:spineopt_operations` must also be present. To deactivate the decomposition functionality, the `model_type` of the master problem can be set to `:spineopt_other`. | ||
This parameter is used, generally, to control [model](@ref) dependent functionality and specify [model](@ref)-level parameters for different [model](@ref)s. Currently, the main use is to identify the [model](@ref) objects that represent the master and operational sub problems within a decomposed investment problem structure. To trigger the decomposed structure, a [model](@ref) object with `model_type`=`:spineopt_benders_master` must exist and another with `model_type`=`:spineopt_standard` must also be present. To deactivate the decomposition functionality, the `model_type` of the master problem can be set to `:spineopt_other`. | ||
|
||
See also [Decomposition](@ref). | ||
See also [Decomposition](@ref). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The [storages\_invested\_big\_m\_mga](@ref) parameter is used in combination with the MGA algorithm (see [mga-advanced](@ref)). | ||
It defines an upper bound on the maximum difference between any MGA iteration. The big M should be chosen always sufficiently large. (Typically, a value equivalent to | ||
[candidate\_storages](@ref) could suffice.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The [storages\_invested\_mga](@ref) is a boolean parameter that can be used in combination with the MGA algorithm (see [mga-advanced](@ref)). As soon as | ||
the value of [storages\_invested\_mga](@ref) is set to `true`, investment decisions in this connection, or group of storages, will be included in the MGA algorithm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The [units\_invested\_big\_m\_mga](@ref) parameter is used in combination with the MGA algorithm (see [mga-advanced](@ref)). | ||
It defines an upper bound on the maximum difference between any MGA iteration. The big M should be chosen always sufficiently large. (Typically, a value equivalent to | ||
[candidate\_units](@ref) could suffice.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The [units\_invested\_mga](@ref) is a boolean parameter that can be used in combination with the MGA algorithm (see [mga-advanced](@ref)). As soon as | ||
the value of [units\_invested\_mga](@ref) is set to `true`, investment decisions in this connection, or group of units, will be included in the MGA algorithm. |
File renamed without changes.
Oops, something went wrong.