How to select the maximum and minimum value of a variable

  • 12 September 2022
  • 2 replies

Userlevel 1
Badge +4

Good day All,

I have a variable PW(t) where t is index from 1 to 24. What is the command to select the maximum and minimum value of PW(t) and also obtain its average. 


Thank you. 


Best answer by gabiservidone 12 September 2022, 16:51

View original

2 replies

Userlevel 5
Badge +6


I recreated your use case with random numbers as follows. 

Now, to find maximum, minimum and average, I used these functions. 

And the results are:

p_min is 2. 

p_max is 99.

p_avg and p_mean are 53.


If you want the element inside t that has the minimum/maximum value, you need to use these functions:


Userlevel 1
Badge +4

Thank you for this.

Please which of the Identifiers did you use in picture 2 and 3. Do I have to create p_min, p_max, p_mean and p_avg as variables or parameter? You may kindly share the file to aid my understanding. I am new to AIMMS. Please note PW(t) is a variable that is obtained after running the model. 

Thank you once again. 


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

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