help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimization in Octave


From: Urs Hackstein
Subject: Re: Optimization in Octave
Date: Thu, 13 Mar 2014 13:24:27 +0100

2014-03-12 17:19 GMT+01:00, Julien Bect <address@hidden>:
> On 12/03/2014 16:03, Urs Hackstein wrote:
>> Dear Julien, thanks a lot for your detailed explanations. I just
>> started to check them. F->-F doesn't work better. A better starting
>> point improves the result, but I don't know how to choose the
>> appropriate starting point. I assumed that our problem has local
>> optima, but I can't prove it.
>
> Then let's assume that your problem has local optima => you need
> something "less local" than sqp.
>
> The simplest than you can do is use a "random start" approach : use a
> local solver (e.g., sqp) repeatedly from random starting points.
>
> This is very easy to implement with a for loop around the code that you
> already have written :
>
> x_opt = [];
> obj_opt = Inf;
>
> n_try = 100;
>
> for i = 1:n_try,
>
>      lbound = [0.5,0.5,0.5,0.5,5]';
>      ubound = [20,20,20,20,200]';
>      x_init = lbound + (lbound - ubound) .* rand (5, 1);
>
>      F=@(x)(real(p(x(1),x(2),x(3),x(4),x(5))));
>      G=@(x)(imag(p(x(1),x(2),x(3),x(4),x(5)))-b);
>      h=@(x) (1.85.*x(1:2,1) - x(3:4,1))
>      [x, obj] = sqp(x_init,F,G,h,lbound,ubound,500)
>
>      if obj < obj_opt,
>          x_opt = x;
>          obj_opt = obj
>      endif
>
> endfor
>
> If your problem is very difficult you might have to increase n_try, of
> course.
>
>

I suppose you meant
x_init = lbound + (ubound - lbound) .* rand (5, 1);

If I change F->-F or F->1/F to get an minimization problem, the
following error still occurs:

opt6(9.954e+10)
error: qp: equality constraint matrix must be full row rank
error: called from:
error:   /usr/share/octave/3.2.4/m/optimization/qp.m at line 247, column 4
error:   /usr/share/octave/3.2.4/m/optimization/sqp.m at line 414, column 34
error:   /home/hackstein/.../opt6.m at line 17, column 15

and it seems that sqp ends prematurely.
I can't see what is wrong with the equality constraint G. The only
thing I remarked is that the evaluations of p just before the output
ends are mostly real numbers.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]