Hello Haroune,
the example below shows how to use the iterated form of the max and min functions.
set T := { 1 .. 10 };
param p{t in T} := sin(t);
display p;
printf "The maximum value of p[t] is %f\n", max{t in T} p[t];
printf "The corresponding t is %d\n", min{t in T : p[t] == max{u in T} p[u]} t;
param p{t in T} := sin(t);
display p;
printf "The maximum value of p[t] is %f\n", max{t in T} p[t];
printf "The corresponding t is %d\n", min{t in T : p[t] == max{u in T} p[u]} t;
Best regards
Heinrich Schuchardt
Heinrich Schuchardt
Gesendet: Freitag, 19. Juni 2015 um 21:29 Uhr
Betreff: [Help-glpk] maximum function
Betreff: [Help-glpk] maximum function
Hello everyone!
I need your help please. Is it possible to get the maximum of a variable only in one of her dimension?
For example : I have the variable X[i,j,t] and I want to define something like that (after the optimisation) :
param Xmax {i in A, j in B} := max {X[i,j,t]}.
The problem is I don't know how and where to define "t in H"?
Thank you so much for your help :-)
Haroune
_______________________________________________ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk