optimproblem object: Change variable bounds
Mostrar comentarios más antiguos
"OptimizationProblem property 'Variables' is read-only". That is the message I get after trying to change something like:
prob.Variables.x.LowerBound = lb
where prob is an optimproblem object.
How can I get around this? Another issue I found was that I could not add variables to the problem, for the same reason. I got around this by adding dummy constraints with all zero coefficients. Overall I like this new tool, it is very convenient, but there should be a way to manipulate variables easily. I am using 2017b.
5 comentarios
Alan Weiss
el 23 de En. de 2018
That is an interesting observation about resetting the bounds. The team is looking into it. Meanwhile, Matt has given very good advice.
Alan Weiss
MATLAB mathematical toolbox documentation
Opt User
el 23 de En. de 2018
Alan Weiss
el 23 de En. de 2018
Indeed, the problem-based approach is not really supposed to be used with other solvers for that reason, among others. It is supposed to be used with solve. If you can get it to work for you with other solvers, great, but it is outside of the current design scope to do so.
Alan Weiss
MATLAB mathematical toolbox documentation
Matt J
el 23 de En. de 2018
If you can get it to work for you with other solvers, great, but it is outside of the current design scope to do so.
That seems to throw into question the purpose of offering a prob2struct() method in the first place.
On the other hand, I don't think it would be difficult for the user to reconstruct the connection between the problem-based names and the solver form, assuming TMW guarantees that the ordering of the variables/constraints in both forms will always be the same. I think this is undocumented, currently.
Opt User
el 24 de En. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Problem-Based Nonlinear Optimization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!