HELP 3 variable optimization use fmincon
9 ビュー (過去 30 日間)
古いコメントを表示
I want to input many wave frequency values as input values and optimize three variables (length, width, draft) of the formula. F(w)=NG (F(w) is an expression consisting of a variable angular velocity, and NG is a complex expression consisting of the length, width, and draft of a ship) Here, I want to optimize the length, width, and draft of a ship for each angular velocity, but how? can i do it
0 件のコメント
回答 (1 件)
Alan Weiss
2023 年 8 月 8 日
The short answer is you put all your variables into one variable, and call a solver on the one variable objective function. For example, x(1) could represent length, x(2) could represent width, and x(3) could represent draft. You also seem to have another variable, x(4) is angular velocity, but I am not sure that you want to optimize over x(4) or if angular velocity is a parameter, in which case you would have this not as x(4) but as another variable, maybe w. In any case, write your constraints and objective function in terms of x, and then call fmincon to solve things. See https://www.mathworks.com/help/optim/ug/example-nonlinear-constrained-minimization.html and https://www.mathworks.com/help/optim/ug/writing-scalar-objective-functions.html for more directions, and see Passing Extra Parameters for how to pass extra parameters.
Alan Weiss
MATLAB mathematical toolbox documentation
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Problem-Based Optimization Setup についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!