### Display optimal solution

Posted:

**Fri Apr 09, 2021 3:30 pm**Hey everyone,

I'm quite new to gams and to solve a problem where I have to find an optimal order quantity.

In my model I am using a method where the optimal quantity is found by minimizing the average costs for each period.

I actually think that my model is fine but I'm struggling with displaying my optimal solution.

Basically I want the model to display the optimal quantity y and the minimal costs (C). But as C is not indexed I don't think that I can use the operation SMIN.

I also tried to display y and C below each other (see line 45 / 46 of my model) to see if I can find the solution manually. But as you can see only the C-value of the last loop is displayed.

Also in my actual model I'm calculating the costs for order quantities from 1 to 1500 - so this would be very arduous.

Does anyone have an idea how to solve this?

Thanks

I'm quite new to gams and to solve a problem where I have to find an optimal order quantity.

In my model I am using a method where the optimal quantity is found by minimizing the average costs for each period.

I actually think that my model is fine but I'm struggling with displaying my optimal solution.

Basically I want the model to display the optimal quantity y and the minimal costs (C). But as C is not indexed I don't think that I can use the operation SMIN.

I also tried to display y and C below each other (see line 45 / 46 of my model) to see if I can find the solution manually. But as you can see only the C-value of the last loop is displayed.

Also in my actual model I'm calculating the costs for order quantities from 1 to 1500 - so this would be very arduous.

Does anyone have an idea how to solve this?

Thanks