help-octave
[Top][All Lists]
Advanced

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

Re: Core function SQP


From: Juan Pablo Carbajal
Subject: Re: Core function SQP
Date: Wed, 3 Aug 2011 12:36:17 +0200

On Mon, Aug 1, 2011 at 12:39 PM, Olaf Till <address@hidden> wrote:
> On Tue, Jul 26, 2011 at 02:43:10PM +0200, Juan Pablo Carbajal wrote:
>> Hi,
>> I have a question regarding the use of sqp.m in octave 3.5.0+
>>
>> He example in the help works fine, but if we add inequalities
>> constraints it fails (or I do not know how to specify them)
>> The code is below
>>
>> function r = g (x)
>>             r = [ sumsq(x)-10;
>>                   x(2)*x(3)-5*x(4)*x(5);
>>                   x(1)^3+x(2)^3+1 ];
>> endfunction
>>
>> function obj = phi (x)
>>             obj = exp(prod(x)) - 0.5*(x(1)^3+x(2)^3+1)^2;
>> endfunction
>>
>> function l = h(x)
>> l = 1 - x.^2;
>> endfunction
>>
>> x0 = [-1.8; 1.7; 1.9; -0.8; -0.8];
>>
>> [x, obj, info, iter, nf, lambda] = sqp (x0, @phi, @g, @h)
>> error: sqp: operator *: nonconformant arguments (op1 is 5x10, op2 is 0x0)
>> error: called from:
>> error: sqp.m at line 472, column 9
>>
>> As far as I can understand, qp returns empty LAMBDA vector when the
>> solution is not feasible. This condition is not being checked in sqp
>> and LAMBDA is used when it is empty.
>>
>> Any suggestion?
>>
>> Thanks
>>
>> --
>> M. Sc. Juan Pablo Carbajal
>> -----
>> PhD Student
>> University of Zürich
>> www.ailab.ch/carbajal
>
> Hi Juan Pablo,
>
> I'm moving this thread to an Octave list, since it is unrelated to
> Octave Forge.
>
> You've seen a known problem. It seems that knowbody had an idea as yet
> how to recover from the situation of qp returning an empty lambda,
> i.e. problem not feasible. In the meantime, one could at least make
> sqp abort in this case. But this would only make the error message a
> bit more specific for you ...
>
> Olaf
>

Olaf,

Thank you very much for your answer. I trivial solution is to pass the
error message that qp is generating there and, as you say, abort the
function. This would make the situation clear for anyone.

Now, I am not an expert on SQP, but I guess the non-feasibility of the
problem is rooted (sometimes at least)in the linearization passed to
qp. Is there a way to perturb the linearized system passed to qp and
try again? Maybe in this way it gets unstuck, maybe not.

I am taking a look at the book of Bertsekas to see whether the problem
is mentioned there.

Thanks

-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
www.ailab.ch/carbajal


reply via email to

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