diff options
Diffstat (limited to '50/DEPENDENCIES/generaliteration2.sce')
-rwxr-xr-x | 50/DEPENDENCIES/generaliteration2.sce | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/50/DEPENDENCIES/generaliteration2.sce b/50/DEPENDENCIES/generaliteration2.sce new file mode 100755 index 000000000..29545493a --- /dev/null +++ b/50/DEPENDENCIES/generaliteration2.sce @@ -0,0 +1,22 @@ +
+function x=generaliteration2(x,g,gp)
+ R=2;
+ PE=10^-8;
+ maxval=10^4;
+ A=[0 0];
+ k=gp(x);
+ if abs(k)>1 then error('function chosen does not converge')
+ abort;
+ end
+ for n=1:1:R
+ x=g(x);
+ disp(x);
+ if abs(g(x))<=PE then break
+ end
+ if (abs(g(x))>maxval) then error('Solution diverges');
+ abort
+ break
+ end
+ end
+ disp(n," no. of iterations =")
+endfunction
\ No newline at end of file |