diff options
author | Harpreet | 2015-11-17 11:34:37 +0530 |
---|---|---|
committer | Harpreet | 2015-11-17 11:34:37 +0530 |
commit | 6a389f6a51bdd88f89706b1c32276d9e1b71ef22 (patch) | |
tree | b289d8f89b5def5b51e5723dcf00631635e4776a /qpipopt | |
parent | 5b9c0073b8722373d41ef19285bdbbade39fd848 (diff) | |
download | OR-toolbox-test-cases-6a389f6a51bdd88f89706b1c32276d9e1b71ef22.tar.gz OR-toolbox-test-cases-6a389f6a51bdd88f89706b1c32276d9e1b71ef22.tar.bz2 OR-toolbox-test-cases-6a389f6a51bdd88f89706b1c32276d9e1b71ef22.zip |
qpipoptmat added
Diffstat (limited to 'qpipopt')
-rw-r--r-- | qpipopt/qpipopt_Q2 (another copy).sce~ | 23 | ||||
-rw-r--r-- | qpipopt/qpipopt_logical_1.sce | 39 | ||||
-rw-r--r-- | qpipopt/qpipopt_logical_1.sce~ | 23 | ||||
-rw-r--r-- | qpipopt/qpipopt_logical_2.sce | 33 | ||||
-rw-r--r-- | qpipopt/qpipopt_logical_2.sce~ | 33 | ||||
-rw-r--r-- | qpipopt/qpipopt_p1.sce | 8 | ||||
-rw-r--r-- | qpipopt/qpipopt_x01.sce | 43 |
7 files changed, 198 insertions, 4 deletions
diff --git a/qpipopt/qpipopt_Q2 (another copy).sce~ b/qpipopt/qpipopt_Q2 (another copy).sce~ new file mode 100644 index 0000000..ea23ee4 --- /dev/null +++ b/qpipopt/qpipopt_Q2 (another copy).sce~ @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check for the Q to be a symmetric matrix +conMatrix= [1,-1,1,0,3,1; +-1,0,-3,-4,5,6; +2,5,3,0,1,0 +0,1,0,1,2,-1; +-1,0,2,1,1,0]; +conLB=[1;2;3;-%inf;-%inf]; +conUB = [1;2;3;-1;2.5]; +lb=[-1000;-10000; 0; -1000; -1000; -1000]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +//and minimize 0.5*x'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,5); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,nbVar,1); +param = list("MaxIter", 300, "CpuTime", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +//qpipopt: Q is not a symmetric matrix +//at line 152 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/qpipopt/qpipopt_logical_1.sce b/qpipopt/qpipopt_logical_1.sce new file mode 100644 index 0000000..38a8cdd --- /dev/null +++ b/qpipopt/qpipopt_logical_1.sce @@ -0,0 +1,39 @@ +//Find x in R^6 such that: +// A simple example with constraints +conMatrix= [1,-1,1,0,3,1; +-1,0,-3,-4,5,6; +2,5,3,0,1,0 +0,1,0,1,2,-1; +-1,0,2,1,1,0]; +conLB=[1;2;3;-%inf;-%inf]; +conUB = [1;2;3;-1;2.5]; +lb=[-1000;-10000; 0; -1000; -1000; -1000]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +//and minimize 0.5*x'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,nbVar,1); +param = list("MaxIter", 300, "CpuTime", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Output +//lambda = +// +// lower: [1.512D-11,7.496D-12] +// upper: [0,0] +// constraint: [3.1111111,0.4444444,2.999D-11] +// output = +// +// Iterations: 7 +// exitflag = +// +// 0 +// fopt = +// +// - 8.2222223 +// xopt = +// +// 0.6666667 +// 1.3333333 + diff --git a/qpipopt/qpipopt_logical_1.sce~ b/qpipopt/qpipopt_logical_1.sce~ new file mode 100644 index 0000000..cea1b46 --- /dev/null +++ b/qpipopt/qpipopt_logical_1.sce~ @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check for the Q to be a symmetric matrix +conMatrix= [1,-1,1,0,3,1; +-1,0,-3,-4,5,6; +2,5,3,0,1,0 +0,1,0,1,2,-1; +-1,0,2,1,1,0]; +conLB=[1;2;3;-%inf;-%inf]; +conUB = [1;2;3;-1;2.5]; +lb=[-1000;-10000; 0; -1000; -1000; -1000]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +//and minimize 0.5*x'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,nbVar,1); +param = list("MaxIter", 300, "CpuTime", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +//qpipopt: Q is not a symmetric matrix +//at line 152 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/qpipopt/qpipopt_logical_2.sce b/qpipopt/qpipopt_logical_2.sce new file mode 100644 index 0000000..9b02145 --- /dev/null +++ b/qpipopt/qpipopt_logical_2.sce @@ -0,0 +1,33 @@ + +// A simple example without constraints +conMatrix= []; +conLB=[]; +conUB = []; +lb=[]; +ub=[]; +p=[2 -35 -47]'; +Q =[5 -2 -1; -2 4 3; -1 3 5]; +nbVar = 3; +nbCon = 0; +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB) + +//Output +// lambda = +// +// lower: [0,0,0] +// upper: [0,0,0] +// constraint: [0x0 constant] +// output = +// +// Iterations: 1 +// exitflag = +// +// 0 +// fopt = +// +// - 249. +// xopt = +// +// 3. +// 5. +// 7. diff --git a/qpipopt/qpipopt_logical_2.sce~ b/qpipopt/qpipopt_logical_2.sce~ new file mode 100644 index 0000000..5c5694b --- /dev/null +++ b/qpipopt/qpipopt_logical_2.sce~ @@ -0,0 +1,33 @@ +//Find x in R^6 such that: +// Check for the Q to be a symmetric matrix +conMatrix= []; +conLB=[]; +conUB = []; +lb=[]; +ub=[]; +p=[2 -35 -47]'; +Q =[5 -2 -1; -2 4 3; -1 3 5]; +nbVar = 3; +nbCon = 0; +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB) + +//Output +// lambda = +// +// lower: [0,0,0] +// upper: [0,0,0] +// constraint: [0x0 constant] +// output = +// +// Iterations: 1 +// exitflag = +// +// 0 +// fopt = +// +// - 249. +// xopt = +// +// 3. +// 5. +// 7. diff --git a/qpipopt/qpipopt_p1.sce b/qpipopt/qpipopt_p1.sce index eeeaed5..2e9ed37 100644 --- a/qpipopt/qpipopt_p1.sce +++ b/qpipopt/qpipopt_p1.sce @@ -1,5 +1,5 @@ //Find x in R^6 such that: -// Check if the user gives p matrix as a row vector +// Check if the user gives unequal size of 'p' as of the number of variables conMatrix= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 @@ -10,7 +10,7 @@ conUB = [1;2;3;-1;2.5]; lb=[-1000;-10000; 0; -1000; -1000; -1000]; ub=[10000; 100; 1.5; 100; 100; 1000]; //and minimize 0.5*x'*Q*x + p'*x with -p=[1; 2; 3; 4; 5; 6]'; Q=eye(6,6); +p=[1; 2; 3; 4; 5]; Q=eye(6,6); nbVar = 6; nbCon = 5; x0 = repmat(0,nbVar,1); @@ -18,6 +18,6 @@ param = list("MaxIter", 300, "CpuTime", 100); [xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) //Error -//qpipopt: p should be a column vector -//at line 165 of function qpipopt called by : +//qpipopt: The Size of p is not equal to the number of variables +//at line 168 of function qpipopt called by : //[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/qpipopt/qpipopt_x01.sce b/qpipopt/qpipopt_x01.sce new file mode 100644 index 0000000..6a57269 --- /dev/null +++ b/qpipopt/qpipopt_x01.sce @@ -0,0 +1,43 @@ +//Find x in R^6 such that: +// Check if the user gives unequal size of initial guess as of the number of variables +conMatrix= [1,-1,1,0,3,1; +-1,0,-3,-4,5,6; +2,5,3,0,1,0 +0,1,0,1,2,-1; +-1,0,2,1,1,0]; +conLB=[1;2;3;-%inf;-%inf]; +conUB = [1;2;3;-1;2.5]; +lb=[-1000;-10000; 0; -1000; -1000; -1000]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +//and minimize 0.5*x'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,5,1); +param = list("MaxIter", 300, "CpuTime", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +// WARNING: qpipopt: Ignoring initial guess of variables as it is not equal to the number of variables +// lambda = +// +// lower: [1x6 constant] +// upper: [1x6 constant] +// constraint: [1x5 constant] +// output = +// +// Iterations: 13 +// exitflag = +// +// 0 +// fopt = +// +// - 14.843248 +// xopt = +// +// 1.7975426 +// - 0.3381487 +// 0.1633880 +// - 4.9884023 +// 0.6054943 +// - 3.1155623 |