summaryrefslogtreecommitdiff
path: root/260/CH4/EX4.17
diff options
context:
space:
mode:
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