Solved

How to select the maximum and minimum value of a variable

• 2 replies
• 226 views

+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.

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

Userlevel 5
+6

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:

Userlevel 1
+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.