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

2 Ansichten (letzte 30 Tage)
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 Kommentare
TaeWan Kim
TaeWan Kim am 29 Apr. 2019
Verschoben: John D'Errico am 22 Jan. 2023
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 am 30 Apr. 2019
Verschoben: John D'Errico am 22 Jan. 2023
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by