Part of a summation

  • 14 April 2021
  • 2 replies
  • 41 views

Badge

Hello,

Since I'm new to aims, I have (I think) a simple question;

How can I do a part of a summation?

So for example; I've got x1, x2, x3, x4 and x5 as my sets. In my mathematical model is one constraint:  x5 = 10*x1 + 18*x2. How do I get this in AIMMS?


2 replies

Hi @Lau 

Are you able to clarify your question? Or were you able to solve it yourself?

 

Thanks

Userlevel 5
Badge +2

Hello @Lau, your question is not clear. 

 

If x1, x2, … x5 are sets, then how do you want to apply a constraint on sets ?

 

I suppose you mean x1, x2 .. x5 are elements in your set with index i, and you have a variable - say abc(i), and the constraint is 

 

abc(x5) = 10*abc(x1) + 18*abc(x2) 

 

You can write this constraint pretty much like above, just enclose the element names in single quotes. 

 

abc(‘x5’) = 10*abc(‘x1’) + 18*abc(‘x2’) 

 

Is this correct ? If not, can you clarify ? 

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator