GenXProject / GenX.jl

GenX: a configurable power system capacity expansion model for studying low-carbon energy futures. More details at : https://genx.mit.edu
https://genxproject.github.io/GenX.jl/
GNU General Public License v2.0
270 stars 114 forks source link

Scaler #667

Closed Betristor closed 6 months ago

Betristor commented 6 months ago

Description

Sometimes the model will be built into an ill form if some objective terms are quite large or small. To alleviate this problem, we could add a scaling factor to scale the objective function during solving while leaving all other expressions untouched. In example_systems/1_three_zones case, an example ObjScale of 10 could help to change the objective range from [1e-4, 6e+02] to [1e-3, 6e+03].

What type of PR is this? (check all applicable)

Related Tickets & Documents

Checklist

How this can be tested

Add the setting key ObjScale with an appropriate value to genx_settings.yml in any test cases. The objective function will be scaled accordingly.

Post-approval checklist for GenX core developers

After the PR is approved

Betristor commented 6 months ago

@sambuddhac Yes, I have considered ParameterScale setting but this option will scale nearly all the data and parameters we use during the model construction and sequentially influence the outputs since the physical meaning (units) of outputs are scaled. Indeed this ParameterScale setting could help alleviate possible numerical issues in the model, but we still need to face the inconvenience of additional loading burden and output interpretation. While ObjScale operates at a higher level by scaling the objective expression directly, avoiding manipulating inputs and outputs. As for an example, example_systems/2_three_zones_w_electrolyzer case with a ObjScale value of 100 could help to change the objective range from [6e-07, 7e+02] to [6e-03, 7e+04] (similar to example_systems/1_three_zones case mentioned above). But I left the key default as 1 to have examples unchanged.

sambuddhac commented 6 months ago

@nspatank I am assigning this to in order to respond.