Hi,
I would like to define a 2 dimensional set, use it as a variable index and use them in an equation. But I get error using following lines:"Dimensions different"
sets
f /1*3/
r /1*3/
fr(f,r) /1.1
2.(1,2)
3.(1,3)/;
binary variables
v(f,r,gb);
equatios:
e7(d,gb).. k(d,gb)=e= sum(fr,(1min(abs(mod(d,f)r),1))*v(fr,gb));
Could anyone help me with please?
Using 2 dimensional sets
Re: Using 2 dimensional sets
Hi,
To me it seems that the problem isn't caused by variable v or its domain but by the fact that you use the mod function on sets which isn't possible. I also notice that f and r are not under control in the sum.
Maybe you want something like
but that's just a guess. If you could share your code along with an explanation of what you try to implement, you might get better help.
Best,
Fred
To me it seems that the problem isn't caused by variable v or its domain but by the fact that you use the mod function on sets which isn't possible. I also notice that f and r are not under control in the sum.
Maybe you want something like
Code: Select all
e7(d,gb).. k(d,gb)=e= sum(fr(f,r),(1min(abs(mod(d.val,f.val)r.val),1))*v(fr,gb));
Best,
Fred
Re: Using 2 dimensional sets
Thank you Fred
Im actually trying to write this formula and but didnt know how to make r index to be less then f index.
Im actually trying to write this formula and but didnt know how to make r index to be less then f index.
 Attachments

 formula.png (3.37 KiB) Viewed 713 times