Path: news.mathworks.com!not-for-mail
From: Alan_Weiss <aweiss@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Which optimization method to use?
Date: Thu, 28 Mar 2013 08:34:29 -0400
Organization: MathWorks
Lines: 38
Message-ID: <kj1dck$hh5$1@newscl01ah.mathworks.com>
References: <kiv93v$3m7$1@newscl01ah.mathworks.com>
Reply-To: aweiss@mathworks.com
NNTP-Posting-Host: ah-aweiss.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: newscl01ah.mathworks.com 1364474068 17957 172.28.17.56 (28 Mar 2013 12:34:28 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 28 Mar 2013 12:34:28 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4
In-Reply-To: <kiv93v$3m7$1@newscl01ah.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:792175

On 3/27/2013 1:09 PM, Aino wrote:
> Hello all.
>
> I have a function that includes a simulation. The input of the 
> simulation is seven parameters. I need to vary five of the seven 
> parameters to find the combination that would minimize the final 
> output (error that is calculated between a measured signal and the 
> simulated signal). I have somewhat a good initial guess for the five 
> parameters and I know that they should all be positive. I need to do 
> this optimization several times, so computational cost is an issue too.
>
> I tried the optimization with "fminsearch". It worked quite ok, but 
> two problems still occurred. First, one of the five parameters had 
> negative values. This particular parameter is possible to just leave 
> out. Second, it would seem that there are several local minimum that 
> are all feasible when considering the parameter values :( and 
> "fminsearch" didn't always find the global minimum. Also, I think that 
> the output error includes "noise", or maybe one/several parameters are 
> not always relevant.
> I am now trying out "fminsearchbnd" (File Exchange) without the fifth 
> parameter and with lower bounds [0,0,0,0]. However, I was wondering if 
> "fmincon" would be more appropriate for me? I am not sure how to 
> implement it, though. Is there possibly even better (more robust, not 
> too time-consuming) optimization method for me?
>
> Thanks,
> Aino

You might be interested in the documentation on optimizing simulations:
http://www.mathworks.com/help/optim/ug/optimizing-a-simulation-or-ordinary-differential-equation.html

fmincon is indeed an appropriate solver for your problem. It is part of 
Optimization Toolbox. You should use the interior-point or sqp 
algorithms; see
http://www.mathworks.com/help/optim/ug/writing-constraints.html#br9p_ry

Alan Weiss
MATLAB mathematical toolbox documentation