summaryrefslogtreecommitdiff
path: root/260/CH4/EX4.17
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /260/CH4/EX4.17
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '260/CH4/EX4.17')
-rw-r--r--260/CH4/EX4.17/4_17.sce32
1 files changed, 32 insertions, 0 deletions
diff --git a/260/CH4/EX4.17/4_17.sce b/260/CH4/EX4.17/4_17.sce
new file mode 100644
index 000000000..8fc0ef2b7
--- /dev/null
+++ b/260/CH4/EX4.17/4_17.sce
@@ -0,0 +1,32 @@
+//Eg-4.17
+//pg-184
+
+clear
+clc
+
+
+clc;
+clear;
+Aold=[1 -3 2 0 0];//4-7 terms are added inorder to satisfy condition no.84 in book
+n=0;
+r=1;
+//iterations are continued till 10^35
+while r/10^35 <= 1
+ for i=1:2
+ summ=0;
+ for k=1:i
+ summ=summ+2*((-1)^k)*Aold(i+k+1)*Aold(i+1-k);
+ end
+ Anew(i)=((-1)^i)*((Aold(i+1))^2+summ);
+ end
+ Aold=[1 Anew(1) Anew(2) 0 0 ];
+ r=max(abs(Anew));
+ n=n+1;
+end
+
+
+r1=abs(Anew(1))^(1/2^n);
+r2=abs(Anew(2)/Anew(1))^(1/2^n);
+
+disp(r1);
+disp(r2); \ No newline at end of file