Skip to main content
Solved

Substitute for "sumproduct" Function in Excel

  • March 16, 2022
  • 2 replies
  • 80 views

Forum|alt.badge.img

Hey Guys,

I have a small problem by modeling my MILP.

I created a Matrix do define some Binary Variables. Now I want to create a constraint, which contains a multiplication between the Matrix of the Variables an a Matrix with some parameters. The result should be a scalar value comparable to the sumproduct-function in Excel. I want to do a multiplication between the matrices an the result should be a scalar?

Hopefully there is a simple function in Aimms to solve my problem.

I am thankful for every help!

Best regards

Simon

Best answer by gdiepen

If the variables and the parameters share the same indices, this could be done with 

 

sum( (indexOne, indexTwo), yourParameter(indexOne, indexTwo) * BinaryVariable(indexOne, indexTwo))

 

If this is not what you mean, then please clarify a bit what you want to achieve

2 replies

gdiepen
AIMMS Champ
Forum|alt.badge.img+7
  • AIMMS Champ
  • 155 replies
  • Answer
  • March 16, 2022

If the variables and the parameters share the same indices, this could be done with 

 

sum( (indexOne, indexTwo), yourParameter(indexOne, indexTwo) * BinaryVariable(indexOne, indexTwo))

 

If this is not what you mean, then please clarify a bit what you want to achieve


Forum|alt.badge.img
  • Author
  • Enthusiast
  • 6 replies
  • March 18, 2022

Thank you really much. I had a small mistake in the indices, which caused some problems in my Model.

Thanks a lot!



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

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