Question about 2 output optimization

7 次查看(过去 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!

采纳的回答

Alan Weiss
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
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
Kokalz
Kokalz 2014-10-7
That's exactly what I was looking for! I'll give it a go. Huge thank you for your help!

请先登录,再进行评论。

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by