### MATLAB >> root separation method in flood analysis

Hi

http://www.hydrol-earth-syst-sci.net/7/151/2003/hess-7-151-2003.html
http://www.hydrol-earth-syst-sci.net/7/151/2003/hess-7-151-2003.pdf
and i want to implement this in matlab

is there someone who fully understand this article?
i need to talk wit him/her :-)

with regards
Piotrek

```Hi!

I have to evaluate x^3-x^2-x-1=0 and its 1rst derivative using Horner's method and then I have to find the remaining roots of the polynomial.
I made 3 codes. One for Newton, the 2nd for Horner and the 3rd is the main one. They are not working and I don't know what else can I do. If someone can help I'll appreciate it a lot!
Here are the codes.
Glomar

function [pval,pp]=hornerV(a,z)
n=length(a);
pval=a(n)*ones(size(z));
pp=pval;
for k=n-1:-1:2
pval=a(k)+z.*pval;
pp=pval+z.*pp;
end
pval=a(1)+z.*pval;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function y=newtonf(y,yp,x0)

if nargin<4
tol=1.0e-4;
end
if nargin<5
itermax=20;
end
x=x0;
normx=0;
normz=inf;
iter=0;
while (normz>tol*normx)&(iter<=itermax)
[fp,fp0]=feval(f,x);
z=-fp0\f0;
normz=norm(z,2);
normx=norm(x,2);
x=x+z;
iter=iter+1;
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function y=polynomial(x0)
coef=[-1 -1 -1 1];
x0=linspace(-5,5,100);
[y,yp]=hornerV(coef,x0);
plot(x0,y,x0,yp);legend y yp;grid on
```

```I am trying to write a newtons method program that will find multiple
roots. The function is a tan function and I am trying to find the
first 10 roots. how do i loop the newton program to find the next
root?
```

```Hi
I have a very complicated function which is a combination of different
bessels functions. I like to find all the real and complex roots of
this function. I need a robust algorithm to calculate these roots
accurately. I appreciate if somebody could help me.
thanks
shahraam

```

```Hi!

I need an implimentation of the muller method for finding N roots of an
arbitrary
complex function with defaltion. So that if a few roots have been
found, they
are excuded from the search.

I shall be thankful to you !!

Regards
mintoo

```