Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Question on fmincon input value
Replies: 1   Last Post: Jan 31, 2013 10:42 AM

 Alan Weiss Posts: 1,430 Registered: 11/27/08
Re: Question on fmincon input value
Posted: Jan 31, 2013 10:42 AM

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
>
> 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
http://www.mathworks.com/help/optim/ug/choosing-a-solver.html#brhkghv-21

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