Open jonaswagner2826 opened 8 months ago
@amvellucci - is this a feature that you think would be easy to add to those conZono methods? The simpilist implementation is likely to have an optional output of [prob, x0] instead of just prob
Disscussion note:
I think this snippet will fix the issue of not having initial conditions for your variables....
vars = fieldnames(prob.Variables);
vals = struct();
for i = 1:length(vars)
var = vars{i};
vals.(var) = zeros(size(prob.Variables.(var)));
end
[sol, fval, exitflag] = solve(prob, vals, 'Options',options);
@jruths Assuming that zeros are reasonable (although potentially infeasible) values, then yes that would generate what I was looking for.
Ideally we should generate those and provide them as optional outputs to the enforceSetContain() function (and having it append to an exististing inputted solution struct would also be nice, but less critical)... It would be very tedious to do that (along with bookkeeping of and not overwriteing additional variables) every time you call enforceSetContain and want to give any initial guess at all
I see what you're saying. Let's put this into our optimvar discussion with Dr Koeln
When working with additional optimvars() within a problem sometimes an initial condition is required (or just desired) and thus an initial (ideally feasible) solution with the appropriate variable names is needed.