summaryrefslogtreecommitdiff
path: root/260/CH4/EX4.17/4_17.sce
blob: 8fc0ef2b73f461baabcefb1b3f62c53a0a260d5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);