help-octave
[Top][All Lists]
Advanced

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

Re: sqp in octave 3.6.4 vs. in octave 3.2.4


From: Urs Hackstein
Subject: Re: sqp in octave 3.6.4 vs. in octave 3.2.4
Date: Fri, 26 Apr 2013 12:25:55 +0200

So, here is now a simplified test case. The polynomial poly is in reality much more complicated:

function poly=poly(la, lb, lc, Ia, Ib, Ic, RC)
poly=[1 la+lb*RC*45*la.^7 lb+lc-RC-3*Ib*Ic Ia*RC+Ib+87*RC Ib*Ic.^3+Ic/(Ia+Ic-la) RC-Ia*Ia*lc la*RC*Ib+Ia*RC la-lb*lc+Ia*Ib/RC+(la.^2*lb*lc-Ia)]
endfunction

function domi=dominant2(ns)
anfang=time();
if ( real(ns(1))>=real(ns(2)) & real(ns(1))>=real(ns(3)) & real(ns(1))>=real(ns(4)) & real(ns(1))>=real(ns(5)) & real(ns(1))>=real(ns(6)) & real(ns(1))>=real(ns(7)) )
domi=real(ns(1))+abs(imag(ns(1)))*i
else if (real(ns(2))>=real(ns(1)) & real(ns(2))>=real(ns(3)) & real(ns(2))>=real(ns(4)) & real(ns(2))>=real(ns(5)) & real(ns(2))>=real(ns(6)) & real(ns(2))>=real(ns(7)))
domi=real(ns(2))+abs(imag(ns(2)))*i
else if (real(ns(3))>=real(ns(1)) & real(ns(3))>=real(ns(2)) & real(ns(3))>=real(ns(4)) & real(ns(3))>=real(ns(5)) & real(ns(3))>=real(ns(6)) & real(ns(3))>=real(ns(7)) )
domi=real(ns(3))+abs(imag(ns(3)))*i
else if( real(ns(4))>=real(ns(1)) & real(ns(4))>=real(ns(2)) & real(ns(4))>=real(ns(3)) & real(ns(4))>=real(ns(5)) & real(ns(4))>=real(ns(6)) & real(ns(4))>=real(ns(7)) )
domi=real(ns(4))+abs(imag(ns(4)))*i
else if (real(ns(5))>=real(ns(1)) & real(ns(5))>=real(ns(2)) & real(ns(5))>=real(ns(3)) & real(ns(5))>=real(ns(4)) & real(ns(5))>=real(ns(6)) & real(ns(5))>=real(ns(7)) )
domi=real(ns(5))+abs(imag(ns(5)))*i
else if (real(ns(6))>=real(ns(1)) & real(ns(6))>=real(ns(2)) & real(ns(6))>=real(ns(3)) & real(ns(6))>=real(ns(4)) & real(ns(6))>=real(ns(5)) & real(ns(6))>=real(ns(7)) )
domi=real(ns(6))+abs(imag(ns(6)))*i
else if ( real(ns(7))>=real(ns(1)) & real(ns(7))>=real(ns(2)) & real(ns(7))>=real(ns(3)) & real(ns(7))>=real(ns(4)) & real(ns(7))>=real(ns(5)) & real(ns(7))>=real(ns(6)))
domi=real(ns(7))+abs(imag(ns(7)))*i
endif
endif
endif
endif
endif
endif
endif
ende=time();
ende-anfang;
endfunction
 
For the other routines, see my previous posts.

2013/4/25 Urs Hackstein <address@hidden>


---------- Forwarded message ----------
From: Urs Hackstein <address@hidden>
Date: 2013/4/25
Subject: Re: sqp in octave 3.6.4 vs. in octave 3.2.4
To: marco atzeri <address@hidden>


Unfortunately, I have no "simple" test case, but the crucial steps are the following:

function mini=minimize6(b)
funp6wrap = @(x)funp6(x,[real(b),imag(b)])
y0  = 2*ones(7,1);
lbound = [0.5,0.5,0.5,0.5,0.5,0.5,5]';
ubound = [20,20,20,20,20,20,200]';
mini=sqp (y0,funp6wrap,[],[],lbound,ubound)
endfunction

function erg=funp6(x,p)
erg=(p(1)-real(dominant2(roots(poly(x(1),x(2),x(3),x(4),x(5),x(6),x(7)))))).^2+(p(2)-imag(dominant2(roots(poly(x(1),x(2),x(3),x(4),x(5),x(6),x(7)))))).^2
endfunction

Here b is a complex number and poly(x(1),x(2),x(3),x(4),x(5),x(6),x(7)) is a polynomial of degree 7, parametrized by the seven real parameters x(1),x(2),x(3),x(4),x(5),x(6) and x(7). Note that poly is here not octave's build-in-function poly.m. dominant2 selects the root of the polynomial with the biggest real part.





2013/4/25 marco atzeri <address@hidden>
On 4/25/2013 10:31 AM, Urs Hackstein wrote:
Hello,

have there been changes in sqp from octave version 3.2.4 to octave
version 3.6.4?

I will bet something has been applied (directly or indirectly)


My program runs without any error in version 3.2.4 whereas in version
3.6.4 we receive the error warning: sqp: QP subproblem failed to
converge in 200 iterations
every time we call sqp.
Is there a way to fix this problem?

Best regards,

Urs Hackstein


could you provide a test case ?

Marco







2013/4/25 Urs Hackstein <address@hidden>


---------- Forwarded message ----------
From: Urs Hackstein <address@hidden>
Date: 2013/4/25
Subject: Re: sqp in octave 3.6.4 vs. in octave 3.2.4
To: marco atzeri <address@hidden>


Unfortunately, I have no "simple" test case, but the crucial steps are the following:

function mini=minimize6(b)
funp6wrap = @(x)funp6(x,[real(b),imag(b)])
y0  = 2*ones(7,1);
lbound = [0.5,0.5,0.5,0.5,0.5,0.5,5]';
ubound = [20,20,20,20,20,20,200]';
mini=sqp (y0,funp6wrap,[],[],lbound,ubound)
endfunction

function erg=funp6(x,p)
erg=(p(1)-real(dominant2(roots(poly(x(1),x(2),x(3),x(4),x(5),x(6),x(7)))))).^2+(p(2)-imag(dominant2(roots(poly(x(1),x(2),x(3),x(4),x(5),x(6),x(7)))))).^2
endfunction

Here b is a complex number and poly(x(1),x(2),x(3),x(4),x(5),x(6),x(7)) is a polynomial of degree 7, parametrized by the seven real parameters x(1),x(2),x(3),x(4),x(5),x(6) and x(7). Note that poly is here not octave's build-in-function poly.m. dominant2 selects the root of the polynomial with the biggest real part.





2013/4/25 marco atzeri <address@hidden>
On 4/25/2013 10:31 AM, Urs Hackstein wrote:
Hello,

have there been changes in sqp from octave version 3.2.4 to octave
version 3.6.4?

I will bet something has been applied (directly or indirectly)


My program runs without any error in version 3.2.4 whereas in version
3.6.4 we receive the error warning: sqp: QP subproblem failed to
converge in 200 iterations
every time we call sqp.
Is there a way to fix this problem?

Best regards,

Urs Hackstein


could you provide a test case ?

Marco






reply via email to

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