diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/fgoalattain.dem.sce | 14 | ||||
-rw-r--r-- | demos/fminbnd.dem.sce | 2 | ||||
-rw-r--r-- | demos/fmincon.dem.sce | 3 | ||||
-rw-r--r-- | demos/fminimax.dem.sce | 12 | ||||
-rw-r--r-- | demos/fminunc.dem.sce | 2 | ||||
-rwxr-xr-x | demos/linprog.dem.sce | 2 | ||||
-rw-r--r-- | demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce (renamed from demos/sci_symphony.dem.gateway.sce) | 10 |
7 files changed, 23 insertions, 22 deletions
diff --git a/demos/fgoalattain.dem.sce b/demos/fgoalattain.dem.sce index 89a5957..345509b 100644 --- a/demos/fgoalattain.dem.sce +++ b/demos/fgoalattain.dem.sce @@ -3,7 +3,7 @@ mode(1) // Demo of fgoalattain.sci // -function f1 = fun(x) +function f1 = gattainObjfun(x) f1(1)=2*x(1)*x(1)+x(2)*x(2)-48*x(1)-40*x(2)+304 f1(2)=-x(1)*x(1)-3*x(2)*x(2) f1(3)=x(1)+3*x(2)-18 @@ -11,16 +11,10 @@ f1(4)=-x(1)-x(2) f1(5)=x(1)+x(2)-8 endfunction x0=[-1,1]; -halt() // Press return to continue - goal=[-5,-3,-2,-1,-4]; weight=abs(goal) -//xopt = [-0.0000011 -63.999998 -2.0000002 -8 3.485D-08] -//fval = [4 3.99] -halt() // Press return to continue - +//gval =[- 0.0000011 -63.999998 -2.0000002 -8 3.485D-08] +//z = [4 3.99] //Run fgoalattain -[xopt,fval,attainfactor,exitflag,output,lambda]=fgoalattain(fun,x0,goal,weight) -halt() // Press return to continue - +[x,fval,attainfactor,exitflag,output,lambda]=fgoalattain(gattainObjfun,x0,goal,weight) //========= E N D === O F === D E M O =========// diff --git a/demos/fminbnd.dem.sce b/demos/fminbnd.dem.sce index a9b4865..7d83057 100644 --- a/demos/fminbnd.dem.sce +++ b/demos/fminbnd.dem.sce @@ -20,6 +20,7 @@ x2 = [2, 2, 2, 2, 2, 2]; options=list("MaxIter",[1500],"CpuTime", [100],"TolX",[1e-6]) //Calling Ipopt [x,fval] =fminbnd(f, x1, x2, options) +// Press ENTER to continue halt() // Press return to continue //Find x in R such that it minimizes: @@ -34,6 +35,7 @@ x1 = [0]; x2 = [1000]; //Calling Ipopt [x,fval,exitflag,output,lambda] =fminbnd(f, x1, x2) +// Press ENTER to continue halt() // Press return to continue //The below problem is an unbounded problem: diff --git a/demos/fmincon.dem.sce b/demos/fmincon.dem.sce index 790c67f..dc6aa39 100644 --- a/demos/fmincon.dem.sce +++ b/demos/fmincon.dem.sce @@ -38,6 +38,7 @@ endfunction options=list("GradObj", fGrad, "Hessian", lHess); //Calling Ipopt [x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) +// Press ENTER to continue halt() // Press return to continue //Find x in R^3 such that it minimizes: @@ -79,6 +80,7 @@ endfunction options=list("MaxIter", [1500], "CpuTime", [500], "GradObj", fGrad, "Hessian", lHess,"GradCon", cGrad); //Calling Ipopt [x,fval,exitflag,output] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) +// Press ENTER to continue halt() // Press return to continue //The below problem is an unbounded problem: @@ -104,6 +106,7 @@ ub=[0,0,0]; options=list("MaxIter", [1500], "CpuTime", [500]); //Calling Ipopt [x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,[],options) +// Press ENTER to continue halt() // Press return to continue //The below problem is an infeasible problem: diff --git a/demos/fminimax.dem.sce b/demos/fminimax.dem.sce index 404af00..d8c462c 100644 --- a/demos/fminimax.dem.sce +++ b/demos/fminimax.dem.sce @@ -16,11 +16,11 @@ 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] +xopt = [4 4] +fopt = [0 -64 -2 -8 0] maxfopt = 0 // Run fminimax -[xopt,fopt,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) +[x,fval,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) // Press ENTER to continue halt() // Press return to continue @@ -65,9 +65,9 @@ minimaxOptions = list("GradObj",myfungrad,"GradCon",cgrad); // The initial guess x0 = [0,10]; // The expected solution : only 4 digits are guaranteed -//xopt = [0.92791 7.93551] -//fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] +xopt = [0.92791 7.93551] +fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] maxfopt = 6.73443 // Run fminimax -[xopt,fopt,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) +[x,fval,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) //========= E N D === O F === D E M O =========// diff --git a/demos/fminunc.dem.sce b/demos/fminunc.dem.sce index 80eed72..a43603e 100644 --- a/demos/fminunc.dem.sce +++ b/demos/fminunc.dem.sce @@ -23,6 +23,7 @@ endfunction options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", fGrad, "Hessian", fHess); //Calling Ipopt [xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options) +// Press ENTER to continue halt() // Press return to continue //Find x in R^2 such that the below function is minimum @@ -35,6 +36,7 @@ endfunction x0=[2,1]; //Calling Ipopt [xopt,fopt]=fminunc(f,x0) +// Press ENTER to continue halt() // Press return to continue //The below problem is an unbounded problem: diff --git a/demos/linprog.dem.sce b/demos/linprog.dem.sce index 337a5dc..074cf61 100755 --- a/demos/linprog.dem.sce +++ b/demos/linprog.dem.sce @@ -60,5 +60,5 @@ halt() // Press return to continue filepath = get_absolute_file_path('linprog.dem.sce'); filepath = filepath + "exmip1.mps" -[xopt,fopt,exitflag,output,lambda] =linprog(filepath); +[xopt,fopt,exitflag,output,lambda] =linprog(filepath) //========= E N D === O F === D E M O =========// diff --git a/demos/sci_symphony.dem.gateway.sce b/demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce index b3c52f4..739ad2c 100644 --- a/demos/sci_symphony.dem.gateway.sce +++ b/demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce @@ -1,16 +1,16 @@ // Copyright (C) 2015 - IIT Bombay - FOSSEE // -// Author: Harpreet Singh -// Organization: FOSSEE, IIT Bombay -// Email: harpreet.mertia@gmail.com // This file must be used under the terms of the CeCILL. // This source file is licensed as described in the file COPYING, which // you should have received as part of this distribution. The terms // are also available at // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in -demopath = get_absolute_file_path("sci_symphony.dem.gateway.sce"); +demopath = get_absolute_file_path("sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce"); -subdemolist = ["Symphony", "symphony.dem.sce"; "SymphonyMat", "symphonymat.dem.sce"; "Qpipopt", "qpipopt.dem.sce"; "QpipoptMat", "qpipoptmat.dem.sce";]; +subdemolist = ["Linprog","linprog.dem.sce";"Symphony", "symphony.dem.sce"; "SymphonyMat", "symphonymat.dem.sce"; "Qpipopt", "qpipopt.dem.sce"; "QpipoptMat", "qpipoptmat.dem.sce";"Lsqlin","lsqlin.dem.sce";"Lsqnonneg","lsqnonneg.dem.sce";"Fminunc","fminunc.dem.sce";"Fminbnd","fminbnd.dem.sce";"Fmincon","fmincon.dem.sce"]; subdemolist(:,2) = demopath + subdemolist(:,2); |