Hi,
I'm trying to run the same model again with updated constraint limits, the update will be an average of a calculated variable from the first run. What I am doing now is running the model, analyze the result, average the variable of interest, update the limits manually and rerun the model. Is there a way to do this with loop function?
Thanks,
Ahmed
Rerun the same model with updated constraint
Re: Rerun the same model with updated constraint
Hi
You could do something like this:
I hope this helps
Cheers
Renger
You could do something like this:
Code: Select all
parameter limit 'Updated limit of constraint x' /2/;
equations
constraintx,
constrainty(i);
constraintx..
X =G= limit
constraintsy(i)..
Y(i) =E= ...
set loopnr /1*3/;
loop(loopnr,
solve mymodel;
limit = sum(i, Y.L(i))/ card(i);
);
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist