Loading Results

8 views
Skip to first unread message

Matts Davids

unread,
Jul 21, 2022, 1:34:19 PM7/21/22
to am...@googlegroups.com, be...@ampl.com
Hello Sir,

I am trying to solve an optimization problem that includes worst case scenario implementation. In my Problem I assume that there will be a forecast error of the forecasted variable P_umuriro{WW,TT},  the error is  P_umuriro_error.

I expected to obtain P_umuriro_unc which is equal to  P_umuriro[w,t] + P_umuriro_error[w,t]. However, when I ran this Problem I obtained the P_umuriro_unc which is similar to P_umuriro[w,t]  in normal condition when I ignored the uncertain part. 

Would it be reasonable to call the new P_umuriro[w,t]  the uncertain variable instead of  P_umuriro_unc.?

Again after running this problem I can obtain the best_c, best_r, best_N_HC, best_r_HV. Is it possible to obtain automatically the P_umuriro, P_umuriro_unc, P_umuyoboro, P_ch, P_d associated to the bestobj, best_c, best_r, best_N_HC, best_r_HV? ( In my case I am doing it manually by setting the best_c, best_r, best_N_HC, best_r_HV in Foodversion.mod file as parameters and run again such as: model Foodversion.mod; data Foodversion.dat; option solver gurobi; option gurobi_options 'nonconvex=2'; solve;) Could you help me to obtain this solution directly after running the Foodversion.run if that is possible?

Attached is my codes

Sincerely,
Davids
Foodversion.dat
Foodversion.run
Foodversion.mod

AMPL Google Group

unread,
Jul 23, 2022, 12:30:35 PM7/23/22
to AMPL Modeling Language
After the for loop is finished, you could solve one more time automatically, with the four parameters set to values in the best run:

let c := best_c;
let r := best_r;
let N_HC := best_N_HC;
let r_HV := best_r_HV;
solve;

If you do not want to solve again in this way, then you could instead save all of the values of interest each time that a better solution is found. For example, before the loop you could define "param best_P_umuriro {WW,TT};". Then every time that an improved solution is discovered, you could execute "let {w in WW, t in TT} best_P_umuriro[w,t] := P_umuriro[w,t];". This would make your program more complicated, however.

(The question involving P_umuriro_error[w,t] seems to present a modeling issue. Is there any AMPL issue in this situation?)


--
Robert Fourer
am...@googlegroups.com
{#HS:1955882944-111114#}

Matts Davids

unread,
Jul 31, 2022, 12:30:32 PM7/31/22
to am...@googlegroups.com
There is no AMPL issue in this situation. I will try to find the modeling issue with  P_umuriro_error[w,t] .

Sincerely,
Davids  

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-1955882944-5801654743-1658593831-1662353080%40helpscout.net.
Reply all
Reply to author
Forward
0 new messages