Skip to main content
Solved

How to select the maximum and minimum value of a variable

  • September 12, 2022
  • 2 replies
  • 317 views

Forum|alt.badge.img+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

Hello, 

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:

 

2 replies

gabiservidone
Administrator
Forum|alt.badge.img+6
  • AIMMSian
  • 256 replies
  • Answer
  • September 12, 2022

Hello, 

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:

 


Forum|alt.badge.img+4
  • Author
  • Enthusiast
  • 10 replies
  • September 12, 2022

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