From: Alan_Weiss <>
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$>
References: <kiv93v$3m7$>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: 1364474068 17957 (28 Mar 2013 12:34:28 GMT)
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$>
Xref: 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:

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

Alan Weiss
MATLAB mathematical toolbox documentation