summaryrefslogtreecommitdiff
path: root/exam.sce
diff options
context:
space:
mode:
Diffstat (limited to 'exam.sce')
-rw-r--r--exam.sce27
1 files changed, 0 insertions, 27 deletions
diff --git a/exam.sce b/exam.sce
deleted file mode 100644
index 819d8d6..0000000
--- a/exam.sce
+++ /dev/null
@@ -1,27 +0,0 @@
-function y = fun(x)
- y = 3*x(1)^2 + 2*x(1)*x(2) + x(2)^2 - 4*x(1) + 5*x(2) ;
-endfunction
-
-[xval, fval, status, gradient, hessian] = intfminunc(fun,[1 2],[2])
-
-x1 = [0,-5];
-x2 = [4,4];
-
-[xval, fval, status, gradient, hessian] = intfminbnd(fun,[1],x1,x2)
-
- //Find x in R^6 such that it minimizes:
- //f(x)= sin(x1) + sin(x2) + sin(x3) + sin(x4) + sin(x5) + sin(x6)
- //-2 <= x1,x2,x3,x4,x5,x6 <= 2
- //Objective function to be minimised
- function y=f(x)
- y=0
- for i =1:6
- y=y+sin(x(i));
- end
- endfunction
- //Variable bounds
- x1 = [-2, -2, -2, -2, -2, -2];
- x2 = [2, 2, 2, 2, 2, 2];
- intcon = [];
- //Options
- [x,fval] =intfminbnd(f ,intcon, x1, x2)