Question: Roots of Bessel Function

Hi,

 

I am trying to find the roots of Hankel function H1(2, z)?

 

j := 1;
for i from 0 to 10 do z0 := i*step+z_min; x[j] := fsolve(f = 0, z = z0, complex) end do;


for p to 10 do for j from p+1 to 9 do if `and`(Re(x[j])-Re(x[p]) < 0.1e-4, Im(x[j])-Im(x[p]) < 0.1e-4) then for i from j to 10 do x[i] := x[i+1] end do; p := p-1; break end if end do end do;

 

the first of these two processes works fine however the second does not. The second on is to get rid of same value solutions! I am not sure if I have missed anything and also is there a way to determine a max value in the complex domain and use it in a for loop?

 

 

any help would be great 

Please Wait...