[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] manipulating parameter indices

From: Kevin Hunter
Subject: [Help-glpk] manipulating parameter indices
Date: Fri, 29 Jun 2012 15:12:19 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

Hello GLPK list,

Is there a method for collecting user-specified parameter indices into an n-dimensional set?

I'm trying to reduce the amount of "knobs" I have to twiddle on a model with which I'm working, and it dawned on my that I have a parameter whose /indices/ contain valuable information that the rest of my model could use.

For the sake of argument, this model has the notion of inputs, processes, and outputs, where the processes convert inputs to outputs. However, processes only operate on 1 or 2 inputs, and only create 1 or 2 outputs. Thus, it would be highly beneficial to automatically create sparse index sets, if for no other reason than helping to check my typing ability. Consider these 5 sets:

set periods :=  2015  2020  2025  2030 ;
set vintage :=  2015  2020  2025  2030 ;

set inputs  :=  coal  oil  uranium  sunlight  gasoline  diesel
                electricity ;

set outputs :=  electricity  gasoline  diesel  heat  miles ;

set processes :=
   coal_pp  diesel_pp  solar_pp   nuclear_pp  refinery
   passive_solar  electric_heat  gas_car  diesel_car;

I might tie these together in my model through an efficiency parameter:

param  eff{i in inputs, p in process, v in vintage, o in outputs} :=
  coal      coal_pp        2015  electricity       0.4
  uranium   nuclear_pp     2015  electricity       0.4
  sunlight  passive_solar  2020  heat              0.6

While it makes sense for a coal power plant to take coal as input, and produce electricity, it does not makes sense for a diesel_car to take take heat and produce sunlight. Consequently, that combination does not exist in the eff parameter indices.

Rather than create an explicit 3-dimensional set that I must manually populate, only to turn around and manually specify the same set for each index in the eff parameter indices, is it possible to harvest the information contained in the parameter indices? I might use this to automatically generate the set of valid indices over which, say, the usable life of each process might be:

param  usable_life {(p,v) in valid_processes} default 30 :=
   coal_pp 2015   15
   coal_pp 2020   17   # GLPK would ostensibly provide an error
                       # message because the eff parameter does
                       # not have the <coal_pp, 2017> tuple in
                       # the (p,v) subset of it's indices.

Does this functionality exist in GLPK? I know at least one other modeling system that provides for it, so I'm hoping that I've just missed something in the gmpl.pdf documentation.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]