Hi all,
I am after some advice on how to extract a value from a proc.
iter := proc(f,I1,I2,N,z) local a,k,:
> x0 := I1:
> x1 := I2:
> for k to N do
> xo := evalf(x0-f(x0)*((x0-x1)/(f(x0)-f(x1))):
> a[s] := a[s],a[0]:
> print(abs(a[s+1]-a[s])):
> if z>abs(a[k]-a[k-1]) and k<=N then
> print(abs(a[s+1]-a[s])):
> end if:
> end do:
> end proc:
in the above f is a function, I1 and I2 are initial values, N is an integer, and z is real. xo describes an iteration. I am trying to find the first iterate for which z>abs(a[k]-a[k-1]) and k<=N, and output this to see if the function converges.
i know the xo part works ok, but i am having trouble extracting the above information.
any help appreciated
slip