Closed lordleoo closed 5 years ago
Thanks, but can you give me a simple, but full example that demonstrates this problem? I'm not able to reproduce it on my machine. For example, the following (extracted from most_ex6_uc.m
) runs just fine for me with no errors, and uses the Gurobi solver ...
mpopt = mpoption('verbose', 2, 'model', 'DC', 'most.solver', 'DEFAULT');
mpc = loadcase('ex_case3b');
xgd = loadxgendata('ex_xgd_uc', mpc);
[iwind, mpc, xgd] = addwind('ex_wind_uc', mpc, xgd);
profiles = getprofiles('ex_wind_profile_d', iwind);
profiles = getprofiles('ex_load_profile', profiles);
nt = size(profiles(1).values, 1);
mdi = loadmd(mpc, nt, xgd, [], [], profiles);
mdo = most(mdi, mpopt);
i used to get this error earlier, but now it's not showing. i'm deeply sorry about this let me close it, and i'll get back to it
No worries. I think this kind of thing could happen if you use mpoption
to create an options struct on a setup that doesn't have Gurobi installed, for example, then save that options struct to a MAT file and later load it into an environment that does have Gurobi installed.
it is mentioned in MOST manual that if you set
most.solver
toDEFAULT
, MOST will try to look for solvers on your computer, and choose one, with a sequence of priorityif you happened to have anyone of those (GUROBI or CPLEX) on your computer, your choice of
DEFAULT
will be changed to one of these solvers the program proceeds to fetch the options of these solvers, from mpopt. if you hadn't already sat these options, this will throw the error: "field not found".For example, inside
gurobi_options
, at line 94, the program assumes that mpopt.gurobi already exists, and proceeds to check for a field namedopt_fname
this will throw an error.The fix would be: inside
miqps_matpower
andqps_matpower
if the program chooses anyone of these priority solvers, it should check if mpopt contains settings for this solver. If not, then some default settings must be set.another fix which I implemented on my copy of most.m is this if-statement