Re: Redefine parameter in Monte Carlo analysis

Thiago Neves <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <CAK6rbN27YcdhBRuv5TcRJU8qQmx9Kt49eGv6rOrs+t055zomgw@mail.gmail.com>
Dear Guidati,
Complementing Michael's answer, instead of creating a single DAT file
containing all the parameters, you can run GLPK with 2 (or more) dat files,
where in one of then you put the fixed parameters and in the other one you
can put the variable (monte carlo sampled) parameters, like below:

FIXED_PARAMS.dat:
{all the fixed parameters you already use in the model}

MONTE_CARLO_PARAMETERS.dat:



*data; param Xnormal := {...} ; param Xadjust := {...} ;end;*

and them run:
glpsol -m [mod file] -d FIXED_PARAMS.dat -d MONTE_CARLO_PARAMETERS.dat

The advantage is that you can create 1000 samples, put them in 1000
different "MONTE_CARLO_PARAMETERS.dat" files, and them run 1000 glpsol
processes in parallel.

Att,

*Thiago H. Neves*
(31) 98608-0666



Em ter., 12 de nov. de 2019 às 14:53, Michael Hennebry <
[email protected]> escreveu:

> On Tue, 12 Nov 2019, Guidati  Gianfranco wrote:
>
> > I am using GLPK to optimize an energy system model for Switzerland. Lots
> of parameters such as costs or efficiencies are defined in a dat file. Now
> I want to systematically vary some of these parameters using a Monte Carlo
> approach. The easiest way to do this would be to just create a small
> addendum to the dat file that redefines / overrides the parameter values
> that were previously defined in the dat file, and to paste these two
> together. Unfortunately, that doesn't work, the solver just complains that
> a parameter was already defined.
>
> Include parameters Xnormal and Xadjust along with parameter X.
> Read in Xnormal and Xadjust instead of X.
> Have X computed from Xnormal and Xadjust.
>
> --
> Michael   [email protected]
> "Sorry but your password must contain an uppercase letter, a number,
> a haiku, a gang sign, a heiroglyph, and the blood of a virgin."
>                                                               --
> someeecards
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.