Solved

Using a parameter as index (nested indexes)

  • 7 July 2021
  • 1 reply
  • 100 views

Badge

Hi all,

I’m sorry of the question is too basic, but I recently had to re-run an old code (originally developed in AIMMS 4.47) and I’m having lots of trouble correcting errors.

I have a variable ( Ireal(ld) ) that uses another variable ( Vreal(bus,ph) ) in its calculation.

I have an string parameter ( load_bus(ld) ) that has the “bus” value for each “ld” and a parameter ( load_ph(ld) ) that has the “ph” value for each “ld”.

In  the old code I used Vreal(load_bus(ld), load_ph(ld)) to calculate the Ireal(ld), but in the new AIMMS version (4.88) I keep getting “The scope of string parameter “load_bus” has not been specified”.

Can anybody please help me in what I’m missing?

Thank you in advance.

icon

Best answer by Chris Kuip 8 July 2021, 08:30

View original

1 reply

Userlevel 5
Badge +7

Hello mglopes,

You can define element parameters

  • ep_load_bus(id) with range bus and definition StringToElement(bus,load_bus(id))
  • ep_load_ph(id) with range ph and definition StringToElement(ph,load_ph(id))

Next you use these element parameters as follows: 

Vreal( ep_load_bus(id), ep_load_ph( id) ).

Hope this helps,

Chris

Reply


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

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