PyPSA / linopy

Linear optimization with N-D labeled arrays in Python
https://linopy.readthedocs.io
MIT License
162 stars 45 forks source link

Support constant values in objective #236

Open 0wenwu opened 7 months ago

0wenwu commented 7 months ago
  1. if the problem need to convert multi-objectives to singe-objective, it's necessary to make normalization involving some constant variables. It's not conveniet to construct objective containing constant, such as x+1 Here is a trick to add constant constant_1=m.add_variables(lower=1, upper=1,name="constant_1")
  2. class Variable only have sum function, other operations are also needed, such as std
FabianHofmann commented 7 months ago

@0wenwu, you are right, the current objective class does not support carrying constants. Let's leave this open and see whether there is more people who wish for this feature.

The std could be easily introduced as function. PRs are always welcome :)