Skip to content

SMSpp-Project/InvestmentBlock

Repository files navigation

InvestmentBlock

InvestmentBlock is designed to model the investment in different assets defined in UCBlock, like generating units and transmission lines.

The InvestmentBlock class, which derives from Block, has a vector of ColVariable, each of which represents the investment in a particular asset. The number of ColVariable is thus the number of assets that are subject to investment. The Objective of the InvestmentBlock is an FRealObjective whose Function is a InvestmentFunction. The active Variable of this InvestmentFunction are the ones defined in this InvestmentBlock.

The InvestmentBlock can have explicit BoxConstraint on the ColVariable, and "implicit" linear constraints can be generated by the InvestmentFunction itself (as "vertical linearizations").

An InvestmentFunction is a C05Function that is capable of evaluating the investment on a set of assets. InvestmentFunction derives from both C05Function and Block. The main ingredients of an InvestmentFunction are the following:

  • The active ColVariable of the InvestmentFunction represent investments that can be made in certain assets. An asset can be one of the following: a ThermalUnitBlock, an IntermittentUnitBlock, a BatteryUnitBlock, or a transmission line in a DCNetworkBlock. The meaning of an investment depends on the type of asset it is associated with.

    • Investing an amount x in a ThermalUnitBlock means that the unit is scaled (see ThermalUnitBlock::scale()) by x.

    • For BatteryUnitBlock and IntermittentUnitBlock, two types of investments can be made. Considering an investment of an amount x, the unit may either be scaled by x (according to UnitBlock::scale()) or have its minimum and maximum power and storage levels scaled by x using set_kappa().

    • Investing an amount x in a transmission line means that its minimum and maximum power flow are scaled by x using set_kappa().

  • The value of the InvestmentFunction is given by a fixed investment cost (CAPEX) and an [expected] operational cost (OPEX). The fixed investment cost is a linear function of the ColVariable of the InvestmentFunction. The [expected] operational cost is given by the solution value of the inner Block (which depends on the investment being made, i.e., the values of the variables of the InvestmentFunction).

  • The InvestmentFunction has an inner Block which contains the assets to invest in. This inner Block can be either a UCBlock or an SDDPBlock. In the former case the OPEX is deterministic. In the latter case it is the expected cost of the sub-Block of the SDDPBlock, some of which (the ones where the investments take place) must themselves be UCBlock. Note that the same amount of investment in the assets is made for all the stages of the SDDPBlock.

Getting started

These instructions will let you build InvestmentBlock on your system.

Requirements

Build and install with CMake

Configure and build the library with:

mkdir build
cd build
cmake ..
cmake --build .

The library has the same configuration options of SMS++.

Optionally, install the library in the system with:

cmake --install .

Usage with CMake

After the library is built, you can use it in your CMake project with:

find_package(InvestmentBlock)
target_link_libraries(<my_target> SMS++::InvestmentBlock)

Build and install with makefiles

Carefully hand-crafted makefiles have also been developed for those unwilling to use CMake. Makefiles build the executable in-source (in the same directory tree where the code is) as opposed to out-of-source (in the copy of the directory tree constructed in the build/ folder) and therefore it is more convenient when having to recompile often, such as when developing/debugging a new module, as opposed to the compile-and-forget usage envisioned by CMake.

Each executable using InvestmentBlock has to include a "main makefile" of the module, which typically is either makefile-c including all necessary libraries comprising the "core SMS++" one, or makefile-s including all necessary libraries but not the "core SMS++" one (for the common case in which this is used together with other modules that already include them). One relevant case is the InvestmentBlock main in the tools/ repo. The makefiles in turn recursively include all the required other makefiles, hence one should only need to edit the "main makefile" for compilation type (C++ compiler and its options) and it all should be good to go. In case some of the external libraries are not at their default location, it should only be necessary to create the ../extlib/makefile-paths out of the extlib/makefile-default-paths-* for your OS * and edit the relevant bits (commenting out all the rest).

Check the SMS++ installation wiki for further details.

Data

We provide some data sets that are used, among other things, by some of the testers of the test repo. Since they are large they are not included in the repo. They are automatically downloaded by CMake if the test repo is included, but if you are not using CMake to build the system you need to do it by hand, via

cd data
wget https://gitlab.com/api/v4/projects/45125867/packages/generic/nc4/latest/nc4.tgz
tar xzvf nc4.tgz

This builds the data/nc4 folder with the InvestmentBlock instances (such as the resilient-data set) used by the tests.

Getting help

If you need support, you want to submit bugs or propose a new feature, you can open a new issue.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting merge requests to us.

Authors

Current Lead Authors

  • Rafael Durbano Lobato
    Dipartimento di Informatica
    Università di Pisa

Contributors

  • Antonio Frangioni
    Dipartimento di Informatica
    Università di Pisa

License

This code is provided free of charge under the GNU Lesser General Public License version 3.0 - see the LICENSE file for details.

Disclaimer

The code is currently provided free of charge under an open-source license. As such, it is provided "as is", without any explicit or implicit warranty that it will properly behave or it will suit your needs. The Authors of the code cannot be considered liable, either directly or indirectly, for any damage or loss that anybody could suffer for having used it. More details about the non-warranty attached to this code are available in the license description file.

About

InvestmentBlock to model the investment in different assets defined in UCBlock. | mirror of https://gitlab.com/smspp/investmentblock

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors