[Top][All Lists]

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

Re: Redefine parameter in Monte Carlo analysis

From: Thiago Neves
Subject: Re: Redefine parameter in Monte Carlo analysis
Date: Tue, 12 Nov 2019 16:36:45 -0300

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:

{all the fixed parameters you already use in the model}

 param Xnormal := {...} ;
 param Xadjust := {...} ;

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.


Thiago H. Neves
(31) 98608-0666

Em ter., 12 de nov. de 2019 às 14:53, Michael Hennebry <address@hidden> 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   address@hidden
"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

reply via email to

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