Date: Jan 31, 2013 10:42 AM
Author: Alan Weiss
Subject: Re: Question on fmincon input value

On 1/30/2013 5:51 AM, Haemish wrote:
> Dear sir,
> I try to solve optimizatino on hybrid vehicle.
> I have some problems about fmincon and would you mind giving me an
> answer?
> The input(generation engine power) range of the problem is 0 kW(off)
> or 20kW~150kW(on).
> But fmincon input seems to require an input of continuous case. (The
> problem is how to treat 0 kW case)
> Can I know if any solutions for that exit?
> And can I know if fmincon matlab 2012 is better than SNOPT?
> Sincerely yours,
> Thank you.
> Minjae Kim

Unfortunately, fmincon requires continuous variables, and does not
handle binary variables, which is what I understand you want. See

You might be able to do a search on all values of the binary variable,
if there are fewer than 20 or so. I mean, set each binary variable to 1
or 0 and solve the problem over the continuous variables. With 20 binary
variables there are 2^20 ~ 10^6 possibilities, and you might be able to
search that many continuous problems.

Good luck,

Alan Weiss
MATLAB mathematical toolbox documentation