optimproblem object: Change variable bounds
古いコメントを表示
"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 件のコメント
Alan Weiss
2018 年 1 月 23 日
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
2018 年 1 月 23 日
Alan Weiss
2018 年 1 月 23 日
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
2018 年 1 月 23 日
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
2018 年 1 月 24 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Problem-Based Nonlinear Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!