summaryrefslogtreecommitdiff
path: root/964/CH13/EX13.1/13_1.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /964/CH13/EX13.1/13_1.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '964/CH13/EX13.1/13_1.sce')
-rwxr-xr-x964/CH13/EX13.1/13_1.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/964/CH13/EX13.1/13_1.sce b/964/CH13/EX13.1/13_1.sce
new file mode 100755
index 000000000..6085f8a74
--- /dev/null
+++ b/964/CH13/EX13.1/13_1.sce
@@ -0,0 +1,22 @@
+//clc()
+//f(x) = 2sinx - x^2/10
+xl(1) = 0;
+xu(1) = 4;
+for i = 1:10
+ d(i) = ((5)^(0.5) - 1)*(xu(i) - xl(i))/2;
+ x1(i) = xl(i) + d(i);
+ x2(i) = xu(i) - d(i);
+ m(i) = 2*sin(x1(i)) - (x1(i)^2)/10;
+ n(i) = 2*sin(x2(i)) - (x2(i)^2)/10;
+ if n(i) > m(i) then
+ xu(i+1) = x1(i);
+ xl(i+1) = xl(i);
+ else
+ xl(i+1) = x2(i);
+ xu(i+1) = xu(i);
+ end
+end
+disp(xl,"xl = ")
+disp(x2,"x2 = ")
+disp(x1,"x1 = ")
+disp(xu,"xu = ")