How can I set a starting point in a situation where I have multiple variables?

2 ビュー (過去 30 日間)
TaeWan Kim
TaeWan Kim 2019 年 4 月 20 日
移動済み: John D'Errico 2023 年 1 月 22 日
I am trying to use the fmincon function in Optimtool.
My objective function is objecfun (w, d) and my constraint function is nonlconstr (w, d, g, x).
The number of variable w is 30(w11, w12, w13, w14, w15, w21, ... , w65), the number of d is 30(d11, d12, d13, d14, d15, d21, ... , d65), g is 6(g1, g2, g3, g4, g5, g6), and x is 3(x1, x2, x3).
I entered a value within the constraint range of each variable at the starting point, but an error of 'x0: matched dimension of the concatenated matrix' occurred.
How do I set the starting point in optimtool?
objecfun.PNG
nonlconstr.PNG
optimtool result.PNG
I look forward to your reply. Thank you.
  9 件のコメント
TaeWan Kim
TaeWan Kim 2019 年 4 月 29 日
移動済み: John D'Errico 2023 年 1 月 22 日
Thank you for your reply.
As a result of checking, it was really - problem.
I have another question. I want only one of several variables to be positive and all others to be zero. Can I add this constraint now?
I look forward to your reply. Thank you.
Best regards.
Taewan Kim
Walter Roberson
Walter Roberson 2019 年 4 月 30 日
移動済み: John D'Errico 2023 年 1 月 22 日
Set the upper and lower bound for the variable to 0 in order to force the variable value to be 0. It is, however, better to substitute constants into the equations and use the modified versions of those.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by