Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
optimization with discrete objective function

Subject: optimization with discrete objective function

From: some

Date: 20 Mar, 2012 12:14:17

Message: 1 of 13

I have an unconstrained optimization problem with a very nonlinear function. The function in question is discrete by which I mean that it will give integer answers such as for example

min: round(sin(x)*100)

What algorithm/function can I use to get a reasonably good result from this kind of problem?

Subject: optimization with discrete objective function

From: Torsten

Date: 20 Mar, 2012 12:35:40

Message: 2 of 13

Am Dienstag, 20. März 2012 13:14:17 UTC+1 schrieb some :
> I have an unconstrained optimization problem with a very nonlinear function. The function in question is discrete by which I mean that it will give integer answers such as for example
>
> min: round(sin(x)*100)
>
> What algorithm/function can I use to get a reasonably good result from this kind of problem?

And it is not possible to turn the objective into a continuous
function as the one above (by changing round(sin(x)*100) into sin(x)*100) ?

Best wishes
Torsten.

Subject: optimization with discrete objective function

From: Seth Deland

Date: 20 Mar, 2012 13:26:50

Message: 3 of 13

Here's an example for optimizing non-smooth objective functions:

http://www.mathworks.com/products/global-optimization/demos.html?file=/products/demos/shipping/globaloptim/nonSmoothOpt.html



"some " <akilles77@gmail.com> wrote in message
news:jk9sap$nvm$1@newscl01ah.mathworks.com...
> I have an unconstrained optimization problem with a very nonlinear
> function. The function in question is discrete by which I mean that it
> will give integer answers such as for example
> min: round(sin(x)*100)
>
> What algorithm/function can I use to get a reasonably good result from
> this kind of problem?

Subject: optimization with discrete objective function

From: some

Date: 20 Mar, 2012 13:56:18

Message: 4 of 13

It is not possible as far as I know. The objective function is the number of steps taken by an algorithm.

Subject: optimization with discrete objective function

From: some

Date: 20 Mar, 2012 13:58:22

Message: 5 of 13

It might seem a bit picky but this is very expensive and even if it seems as if
this might help I can't afford it.

Subject: optimization with discrete objective function

From: Torsten

Date: 20 Mar, 2012 14:31:56

Message: 6 of 13

Am Dienstag, 20. März 2012 14:56:18 UTC+1 schrieb some :
> It is not possible as far as I know. The objective function is the number of steps taken by an algorithm.

And the parameters to be optimized are continuous or discrete or of mixed type ?

Best wishes
Torsten.

Subject: optimization with discrete objective function

From: some

Date: 20 Mar, 2012 14:41:11

Message: 7 of 13

The parameters are continuous but a small change in the parameters will probably result in the same output.

I could make them discrete if that would make the problem easier however.

Subject: optimization with discrete objective function

From: Torsten

Date: 20 Mar, 2012 15:09:06

Message: 8 of 13

Am Dienstag, 20. März 2012 15:41:11 UTC+1 schrieb some :
> The parameters are continuous but a small change in the parameters will probably result in the same output.
>
> I could make them discrete if that would make the problem easier however.

Maybe
http://www.mathworks.com/matlabcentral/fileexchange/95
?

Best wishes
Torsten.

Subject: optimization with discrete objective function

From: some

Date: 20 Mar, 2012 15:21:11

Message: 9 of 13

Hm, branch and bound doesn't that to rely on the value of the objective function changing when altering the parameters into integers? something that is not assured in this problem

Subject: optimization with discrete objective function

From: Steve Grikschat

Date: 21 Mar, 2012 13:53:25

Message: 10 of 13

"some" wrote in message <jka797$4ed$1@newscl01ah.mathworks.com>...
> Hm, branch and bound doesn't that to rely on the value of the objective function changing when altering the parameters into integers? something that is not assured in this problem

It seems to me that this is a continuous, non-smooth optimization problem. Your best bet may be to use a derivative-free method, such as patternsearch/ga (Global Optimization Toolbox), or fminsearch (in MATLAB).

However, I'm still not clear why you can't solve without the round, and then round the solution? This way, you can use gradient-based methods, which are likely to converge faster. Just a thought.

+Steve

Subject: optimization with discrete objective function

From: some

Date: 21 Mar, 2012 14:56:17

Message: 11 of 13

The variables are continuous but the objective function is discrete. The round(sin(x)) was an example. In reality I wish to optimize the number of steps an algorithm takes, it is not possible for said algorithm to take a noninteger number of steps.

The problem with fminsearch is that it doesn't find any changes to the problem.

Subject: optimization with discrete objective function

From: Marcus M. Edvall

Date: 21 Mar, 2012 16:29:54

Message: 12 of 13

You can try a variety of solver options in TOMLAB, for example
minlpBB, KNITRO, minlpSolve and more.

Best wishes, Marc
http://tomopt.com/
http://tomsym.com/

Subject: optimization with discrete objective function

From: Steve Grikschat

Date: 22 Mar, 2012 13:39:13

Message: 13 of 13

"some" wrote in message <jkcq6h$n5q$1@newscl01ah.mathworks.com>...
> The variables are continuous but the objective function is discrete. The round(sin(x)) was an example. In reality I wish to optimize the number of steps an algorithm takes, it is not possible for said algorithm to take a noninteger number of steps.
>
> The problem with fminsearch is that it doesn't find any changes to the problem.

Again, I believe that the problem is non-smooth, not integer. So there is no point in looking at integer solvers.

Perhaps fminsearch doesn't move because of the sensitivity of the objective? Does it take relatively large changes in X to have a change in the output? You may have to adjust tolerances, etc., in order to see any progress.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us