summaryrefslogtreecommitdiff
path: root/tests/general_tests/lsqlin/lsqlin_logical5.sce
diff options
context:
space:
mode:
Diffstat (limited to 'tests/general_tests/lsqlin/lsqlin_logical5.sce')
-rw-r--r--tests/general_tests/lsqlin/lsqlin_logical5.sce57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/general_tests/lsqlin/lsqlin_logical5.sce b/tests/general_tests/lsqlin/lsqlin_logical5.sce
new file mode 100644
index 0000000..0802609
--- /dev/null
+++ b/tests/general_tests/lsqlin/lsqlin_logical5.sce
@@ -0,0 +1,57 @@
+// An example with inequality constraints
+C = [1 1 1;
+ 1 1 0;
+ 0 1 1;
+ 1 0 0;
+ 0 0 1]
+d = [89;
+ 67;
+ 53;
+ 35;
+ 20;]
+A = [3 2 1;
+ 2 3 4;
+ 1 2 3];
+b = [191
+ 209
+ 162];
+Aeq = [1 2 1];
+beq = 10;
+lb = repmat(0.1,3,1);
+ub = repmat(4,3,1);
+x0 = repmat(0,3,1);
+options = list("MaxIter", 300);
+
+//Output
+//Optimal Solution Found.
+// lambda =
+//
+// lower: [5.357D-12,2.334D-11,5.356D-12]
+// upper: [78,6.963D-12,49]
+// eqlin: 95
+// ineqlin: [1.206D-13,1.146D-13,1.449D-13]
+// output =
+//
+// Iterations: 8
+// ConstrViolation: 8.000D-08
+// exitflag =
+//
+// 0
+// residual =
+//
+// 80.
+// 62.
+// 48.
+// 31.
+// 16.
+// resnorm =
+//
+// 13765.
+// xopt =
+//
+// 4.
+// 1.0000000
+// 4.
+
+[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0,options)
+