diff options
author | Harpreet | 2016-01-25 01:05:02 +0530 |
---|---|---|
committer | Harpreet | 2016-01-25 01:05:02 +0530 |
commit | a2d9c2bfd6eb83d1a494821176388eb312d08254 (patch) | |
tree | 611fba3b340ba48b9d9d7435ce2f29b1ce0c12fa /demos/fgoalattain.dem.sce | |
parent | dd3d72ae2cdb43311b4e501966f09694bbd3e505 (diff) | |
download | FOSSEE-Optimization-toolbox-a2d9c2bfd6eb83d1a494821176388eb312d08254.tar.gz FOSSEE-Optimization-toolbox-a2d9c2bfd6eb83d1a494821176388eb312d08254.tar.bz2 FOSSEE-Optimization-toolbox-a2d9c2bfd6eb83d1a494821176388eb312d08254.zip |
functions added
Diffstat (limited to 'demos/fgoalattain.dem.sce')
-rw-r--r-- | demos/fgoalattain.dem.sce | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/demos/fgoalattain.dem.sce b/demos/fgoalattain.dem.sce new file mode 100644 index 0000000..89a5957 --- /dev/null +++ b/demos/fgoalattain.dem.sce @@ -0,0 +1,26 @@ +mode(1) +// +// Demo of fgoalattain.sci +// + +function f1 = fun(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 +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 + +//Run fgoalattain +[xopt,fval,attainfactor,exitflag,output,lambda]=fgoalattain(fun,x0,goal,weight) +halt() // Press return to continue + +//========= E N D === O F === D E M O =========// |