HELP 3 variable optimization use fmincon
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Alan Weiss
el 8 de Ag. de 2023
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 comentarios
Ver también
Categorías
Más información sobre Problem-Based Optimization Setup en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!