Optimizing a Black Box function

20 次查看(过去 30 天)
I have a black box function to be optimized. The input is a scalar and the output to be optimized is also a scalar.In this case, is there any hints on which function or method can I implement? Thanks!
A more specific description: I am trimming a simulink model. Basically it is an aircraft dynamic model to be trimmed. I am trimming the aircraft with the flap, elevator and throttle( input variables ). My strategy is that for any trim point, firstly fix the elevator deflection and throttle, search for the flap deflection which renders minimum drag ( objective function ). Then fix the flap as the searched value, and then search for elevator which trim the whole model.
The code I used for trimming is 'findop' in matlab, which for me is a total black box, and my problem arises when I tried to search for flap deflection which gives minimum drag. The objective function is a scalar (drag coefficient) and the input to be searched is also a scalar (the other two input variables are fixed already). In this case, is it possible to use 'fminbnd'? If possible, any hints on how to implement it in detail? Thanks!!!

回答(1 个)

Alan Weiss
Alan Weiss 2015-5-28
You have three variables: flap, elevator, and throttle. I would try to minimize drag by controlling all three variables at once, not using separate 1-dimensional minimizations. My x variable would have x(1) = flap, x(2) = elevator, and x(3) = throttle. You almost certainly have bounds on these variables. So, depending on your available toolboxes, I would either use fmincon from Optimization Toolbox, or patternsearch from Global Optimization Toolbox, because these solvers allow you to impose bounds.
If you use fmincon, I suggest that you read about optimizing a simulation or ODE, in particular, about setting larger-than-default finite differences.
You will have to figure out for yourself how to connect your Simulink model to an optimizer, I am not familiar enough with Simulink to give you a good answer.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 个评论
Titus Edelhofer
Titus Edelhofer 2015-5-28
You might use the function "sim" for simulating your Simulink model. Take a look at the parameter "SrcWorkspace": it allows you to specify the current workspace for the variables. This way you don't have to assign variables to the base workspace...
If you happen to have Simulink Design Optimization, it helps you with those tasks ...
Titus

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Manual Performance Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by