HELP 3 variable optimization use fmincon

조회 수: 8 (최근 30일)
Ji Heon Baek
Ji Heon Baek 2023년 8월 8일
답변: Alan Weiss 2023년 8월 8일
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

답변 (1개)

Alan Weiss
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

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by