help-octave
[Top][All Lists]
Advanced

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

Re: Newbie question - sqp solver equality constraints function


From: alexegin
Subject: Re: Newbie question - sqp solver equality constraints function
Date: Thu, 22 Jun 2017 00:04:44 -0700 (PDT)

Hi, *Juan Pablo Carbajal-2*!
Thank you very much for answering me. Your test is working perfectly:
clear all;g =@( x ) [ sum( x( x < 0.0 ) ); sum( x( x >= 0.0 ) ) ] - [ -1.0;
1.0 ];c =@( x ) sumsq( x ); x0 = 2.0 * rand( 10, 1 ) - 1.0; tic;[ x obj info
iter nf l ] = sqp( x0, c, g, [], -1.0, 1.0 );toc;
But when I am trying to use constraint function in my script I get the
following error:
error: qp: equality constraint matrix must be full row rank
Here is my script:
clear all;global R = dlmread( "r.csv", "\t" ); # double [ 10x1 ]global Q =
dlmread( "q.csv", "\t" ); # double [ 10x10 ]global Y = dlmread( "y.csv",
"\t" ); # double [ 10x1 ]global lb = dlmread( "lb.csv", "\t" ); # double [
10x1 ]global ub = dlmread( "ub.csv", "\t" ); # double [ 10x1 ]g = @( x ) [
sum( x( x < 0.0 ) ); sum( x( x >= 0.0 ) ) ] - [ -1.0; 1.0 ];function z =
foo( m, n )  z = 0; for i = 1:rows( m ) z = z + m( i, 1 ) * n( i, 1 );
endfor; endfunction;function y = phi( x ) global Y; y = foo( Y, x ) * -1;
endfunctiontic;[ x obj info iter nf l ] = sqp( R, @phi, g, [], -1.0, 1.0
);toc;
What am I doing wrong? Please do not tell me /everything/ 



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Newbie-question-sqp-solver-equality-constraints-function-tp4683834p4683852.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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