Question about 2 output optimization
16 次查看(过去 30 天)
显示 更早的评论
Hi guys!
I'm struggling to formulate a typical optimization problem into something than can be solved by MATLAB and was hoping you could assist me with this. I do have optimization toolbox available on my machine, so can use any function offered by the toolbox.
I have a software simulating a very complex non-linear model, that takes a set of inputs and gives me 2 outputs. In this case I am running a batch of simulations, only changing 3 input parameters, so I basically have a matrix of 3 input values and a matrix of output values. My aim is to correlate 1-st output parameter to match real-life data as closely as possible, while keeping the 2nd output parameter equal to a certain value. In other words I am trying to minimize error between real-life data and simulated data (what would be a typical error function for such case?), while imposing an equality constraint on the second output. I obviously cannot write the whole simulation in terms of single f(x) function to minimize.
Any thoughts on how to write such optimization problem and what function is typically used for something like this ?
Thank you for any help!
0 个评论
采纳的回答
Alan Weiss
2014-9-24
This sounds straightforward to solve in Optimization Toolbox. You have a nonlinear equality constraint (the value of the second output) and want to minimize the difference between the first output and some data that you already have (maybe the sum of squares of the differences of the components if it is multidimensional).
You can easily formulate this for fmincon. To save computation time, use the technique described here for the case when your nonlinear constraint and objective function are given by the same computation.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
9 个评论
Alan Weiss
2014-10-6
If it is impossible for MATLAB to communicate with your simulation, then I do not see how you can profitably use MATLAB optimization functions. The functions query various values of the control variables (x) and use the resulting objective function values to guide a search for the lowest objective function consistent with constraints.
But an idea just popped into my head. I suppose that you might write a grid of control variable values, evaluate the objective and constraints on this grid, and then construct an interpolating function that fmincon could evaluate. For an example using this technique, see Pattern Search Climbs Mt. Washington. The objective function, terrainfun, is just a call to interp2. You could do the same with the nonlinear constraint.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surrogate Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!