summaryrefslogtreecommitdiff
path: root/tests/general_tests/fmincon/fmincon_logical10.sce
diff options
context:
space:
mode:
Diffstat (limited to 'tests/general_tests/fmincon/fmincon_logical10.sce')
-rw-r--r--tests/general_tests/fmincon/fmincon_logical10.sce47
1 files changed, 7 insertions, 40 deletions
diff --git a/tests/general_tests/fmincon/fmincon_logical10.sce b/tests/general_tests/fmincon/fmincon_logical10.sce
index 45ffdf3..999ee2c 100644
--- a/tests/general_tests/fmincon/fmincon_logical10.sce
+++ b/tests/general_tests/fmincon/fmincon_logical10.sce
@@ -13,7 +13,7 @@ lb=[];
ub=[];
//Nonlinear constraints
function [c,ceq]=nlc(x)
-c = [x(1)^2 - x(2)^2 + x(3)^2 - 2 , x(1)^2 + x(2)^2 + x(3)^2 - 10];
+c = [x(1)^2 - x(2)^2 + x(3)^2 - 2 ; x(1)^2 + x(2)^2 + x(3)^2 - 10]';
ceq = [];
endfunction
@@ -23,44 +23,11 @@ y= obj*[0,1,0;1,0,1;0,1,0] + lambda(1)*[2,0,0;0,-2,0;0,0,2] + lambda(2)*[2,0,0;0
endfunction
//Options
-options=list("MaxIter", [1500], "CpuTime", [500], "Hessian", lHess);
+options=list("MaxIter", [100], "CpuTime", [500], "Hessian", lHess);
-//Output
-//Optimal Solution Found.
-// hessian =
-//
-// 1.4142136 1.72D-322 2.12D-314
-// 1. 0. 5.82D+252
-// 1. 1.4142136 1.
-// gradient =
-//
-// 2.236068 - 3.1622776 2.236068
-// lambda =
-//
-// lower: [0,0,0]
-// upper: [0,0,0]
-// ineqlin: [0x0 constant]
-// eqlin: [0x0 constant]
-// ineqnonlin: [4.545D-09,0.7071068]
-// eqnonlin: [0x0 constant]
-// output =
-//
-// Iterations: 23
-// Cpu_Time: 0.164
-// Objective_Evaluation: 24
-// Dual_Infeasibility: 6.124D-08
-// Message: "Optimal Solution Found"
-// exitflag =
-//
-// 0
-// fopt =
-//
-// - 7.0710678
-// xopt =
-//
-// - 1.5811388
-// 2.236068
-// - 1.5811388
-
-//Calling Ipopt
+//Calling fmincon
[xopt,fopt,exitflag,output,lambda,gradient,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options)
+disp(xopt,fopt,exitflag,output,lambda,gradient,hessian)
+disp("2nd")
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc)
+disp(xopt,fopt,exitflag,output,lambda,gradient,hessian)