summaryrefslogtreecommitdiff
path: root/newstructure/demos/intfminimax.dem.sce
diff options
context:
space:
mode:
authorHarpreet2016-09-03 00:36:51 +0530
committerHarpreet2016-09-03 00:36:51 +0530
commita0d9443af147e949c1e6a01ac24749d12593ec5b (patch)
tree1a1955c5482ae608fd7f618b06f4ecc6a0d39a23 /newstructure/demos/intfminimax.dem.sce
parent4b64cf486f5c999fd8167758cae27839f3b50848 (diff)
downloadFOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.tar.gz
FOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.tar.bz2
FOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.zip
cbcintlinprog added
Diffstat (limited to 'newstructure/demos/intfminimax.dem.sce')
-rw-r--r--newstructure/demos/intfminimax.dem.sce57
1 files changed, 0 insertions, 57 deletions
diff --git a/newstructure/demos/intfminimax.dem.sce b/newstructure/demos/intfminimax.dem.sce
deleted file mode 100644
index db74b92..0000000
--- a/newstructure/demos/intfminimax.dem.sce
+++ /dev/null
@@ -1,57 +0,0 @@
-mode(1)
-//
-// Demo of intfminimax.sci
-//
-
-// A basic case :
-// we provide only the objective function and the nonlinear constraint
-// function
-function f = myfun(x)
-f(1)= 2*x(1)^2 + x(2)^2 - 48*x(1) - 40*x(2) + 304; //Objectives
-f(2)= -x(1)^2 - 3*x(2)^2;
-f(3)= x(1) + 3*x(2) -18;
-f(4)= -x(1) - x(2);
-f(5)= x(1) + x(2) - 8;
-endfunction
-// The initial guess
-x0 = [0.1,0.1];
-// The expected solution : only 4 digits are guaranteed
-xopt = [4 4]
-fopt = [0 -64 -2 -8 0]
-intcon = [1]
-maxfopt = 0
-// Run fminimax
-[x,fval,maxfval,exitflag] = intfminimax(myfun, x0,intcon)
-// Press ENTER to continue
-halt() // Press return to continue
-
-// A case where we provide the gradient of the objective
-// functions and the Jacobian matrix of the constraints.
-// The objective function and its gradient
-function [f,G] = myfun(x)
-f(1)= 2*x(1)^2 + x(2)^2 - 48*x(1) - 40*x(2) + 304;
-f(2)= -x(1)^2 - 3*x(2)^2;
-f(3)= x(1) + 3*x(2) -18;
-f(4)= -x(1) - x(2);
-f(5)= x(1) + x(2) - 8;
-G = [ 4*x(1) - 48, -2*x(1), 1, -1, 1;
-2*x(2) - 40, -6*x(2), 3, -1, 1; ]'
-endfunction
-// The nonlinear constraints
-function [c,ceq,DC,DCeq] = confun(x)
-// Inequality constraints
-c = [1.5 + x(1)*x(2) - x(1) - x(2), -x(1)*x(2) - 10]
-// No nonlinear equality constraints
-ceq=[]
-DC= [x(2)-1, -x(2);
-x(1)-1, -x(1)]'
-DCeq = []'
-endfunction
-// Test with both gradient of objective and gradient of constraints
-minimaxOptions = list("GradObj","on","GradCon","on");
-// The initial guess
-x0 = [0,10];
-intcon = [2]
-// Run intfminimax
-[x,fval,maxfval,exitflag] = intfminimax(myfun,x0,intcon,[],[],[],[],[],[], confun, minimaxOptions)
-//========= E N D === O F === D E M O =========//