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

Weird investment results caused by temporal block settings #496

Closed
nnhjy opened this issue Oct 13, 2022 · 8 comments
Closed

Weird investment results caused by temporal block settings #496

nnhjy opened this issue Oct 13, 2022 · 8 comments

Comments

@nnhjy
Copy link
Collaborator

nnhjy commented Oct 13, 2022

The issue can be seen in the result of this SpineOpt sample. There are two scenarios, with the only difference in the start time of the temporal block for investment decisions (inv): one begins at the same time as the operational temporal block (opt); the other begins one hour later. Investment in unitA is needed from the 2nd hour on.

Investment results under the synchronised investment temporal block look okay. But under the shorter investment temporal block, the output of unit_invested becomes constantly 0, despite new capacity being actually invested (see unit_available in output). And the de facto investment decisions in two scenarios are slightly different (see unit_invested_available in output).

@mihlema
Copy link
Contributor

mihlema commented Oct 17, 2022

I think the model is sort of working as intended, maybe it is more of a question on how to realize the desired functionality.
The problem with the model you describe is that the unit_invested_transition constraint fails, as there is no "history" investment variables for 2000-01-01T00:00~>2000-01-01T01:00; hence the model has a degree of freedom there.

I think for your use case this could easily be fixed by having the investment temporal block start at the beginning of the optimization, but defining a TimeSeries fix_units_invested for the first timestep of the optimization.

@nnhjy
Copy link
Collaborator Author

nnhjy commented Oct 18, 2022

Thanks! The approach works to realise the need to model units that are supposed to be available for investment later than the beginning of the model horizon.

As per the need for "history" investment, does it also mean a temporal block starting simultaneously as the model is necessary for investment?

@mihlema
Copy link
Contributor

mihlema commented Oct 18, 2022

As per the need for "history" investment, does it also mean a temporal block starting simultaneously as the model is necessary for investment?

I'm not entirely following what you mean by that. Could you clarify?
As I mentioned above, indeed, the investment temporal block would start simultaneously with the model start.

@nnhjy
Copy link
Collaborator Author

nnhjy commented Oct 18, 2022

To make the unit_invested_transition constraint work correctly, do we always need to set the temporal block for investment decisions to start at the same time as the start time of a model?

@mihlema
Copy link
Contributor

mihlema commented Oct 20, 2022

I guess the answer is yes, and no. To explain that maybe a quick word on "history" in SpineOpt.

History time slices are generated for time slices before the model_start; looking back for the length of duration parameters (e.g., lifetime). If a temporal block starts simultaneously to the model_start, these historical values are automatically generated.

However, when a temporal block starts disjoint from the model start, the historical values are not created. I believe the reason for this is amongst other things that if you were to use representative days, each day will be bridged to its previous, adjacent temporal_block (i.e., no separate history variables are created).

It is, however, still possible to create temporal blocks with the history that you desire, without the temporal block starting at the model start: You could for example have your temporal_block start one timestep before your desired start of investments, and again fix the units invested (or units_invested_available) for this "pre-timestep"(i.e., your history timestep).

I hope this helps :)

@mihlema
Copy link
Contributor

mihlema commented Oct 20, 2022

I'll close this issue (feel free to reopen it if questions remain).
If you're interested and have some spare time, it would be great if you'd like to add a section on this to the documentation.

@mihlema mihlema closed this as completed Oct 20, 2022
@nnhjy
Copy link
Collaborator Author

nnhjy commented Oct 20, 2022

@mihlema Many thanks for the explanation! I've got the main idea.

I suppose this function is the one to fix units_invested_available in the "history": https://github.com/Spine-project/SpineOpt.jl/blob/ca4e07160b20258def9b356842ed6d72dccaebe0/src/variables/variable_units_invested_available.jl#L81 There seems no function to fix the units_invested variable.

@DillonJ
Copy link
Collaborator

DillonJ commented Oct 20, 2022

By the way, this relates to issue #455 where we discuss creating new parameters to define explicit initial values rather than using fix_* time series that are awkward to use for this purpose and not relative to the model start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants