diff options
author | Harpreet | 2016-08-09 13:05:52 +0530 |
---|---|---|
committer | Harpreet | 2016-08-09 13:05:52 +0530 |
commit | d8fca69f239a275f5ffdbd870508c86b6e69c678 (patch) | |
tree | 8e102f22a671d2b837c2a030911e6870e790fd41 /docal.sce | |
parent | 9fd2976931c088dc523974afb901e96bad20f73c (diff) | |
parent | de5fe502b7240a48f9d46b9e210060de5c2b185e (diff) | |
download | FOSSEE-Optim-toolbox-development-d8fca69f239a275f5ffdbd870508c86b6e69c678.tar.gz FOSSEE-Optim-toolbox-development-d8fca69f239a275f5ffdbd870508c86b6e69c678.tar.bz2 FOSSEE-Optim-toolbox-development-d8fca69f239a275f5ffdbd870508c86b6e69c678.zip |
Initial upload
Diffstat (limited to 'docal.sce')
-rw-r--r-- | docal.sce | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -2,14 +2,19 @@ ulink(); exec builder.sce exec loader.sce - function y=f(x) - y=x(1)^2+x(2)^2; - endfunction - //Starting point, linear constraints and variable bounds - x0=[3 , 3]; - A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1]; - b=[2;1;2;1;-1;2]; - Aeq=[1,1]; - beq=[2]; - //Calling Ipopt - [x,fval] =intfmincon(f, [3 3],[1 2],[],[]); +function y=f(x) + y=-(x(1)+x(2)+x(3)); +endfunction + +function [c,ceq]=nlc(x) + c=((x(2)-0.5)^2 + (x(3)-0.5)^2 - 0.25 ); + ceq = []; +endfunction + +A = [1 -1 0 0;1 0 1 1;] +b = [0 2]'; +lb =[0 0 0 0] +ub = [1 %inf %inf 5] +intcon = [1 4] +x0 = [0 0 0 0] +[x,fval,exitflag] =intfmincon(f, x0,intcon,A,b,[],[],lb,ub,nlc);
\ No newline at end of file |