Paste: muller's method in matlab

Author: Rex Ford
Mode: ml
Date: Wed, 27 Jan 2010 14:53:39
Plain Text |
function p3=muller(f,p0,p1,p2)



h1=p1-p0;
h2=p2-p1;

d1=(f(p1)-f(p0))/h1;
d2=(f(p2)-f(p1))/h2;
d=(d2-d1)/(h2+h1);
count=3;
h=1;

while count < 20 && abs(h)>1e-14
    b=d2+h2*d;
    D=sqrt(b^2-4*f(p2)*d);
    if abs(b-D)<abs(b+D)
        E=b+D;
    else
        E=b-D;
    end
    h=-2*f(p2)/E;
    p3=p2+h;
    
    if abs(h)>1e-14
        p0=p1;
        p1=p2;
        p2=p3;
        h1=p1-p0;
        h2=p2-p1;
        d1=(f(p1)-f(p0))/h1;
        d2=(f(p2)-f(p1))/h2;
        d=(d2-d1)/(h2+h1);
        count=count+1;
    end
end
        

Annotation: fh

Author: <khk?
Mode: factor
Date: Wed, 8 Feb 2012 12:30:18
Plain Text |
<html>jghj

Annotation: Thanks

Author: Datenshi
Mode: text
Date: Wed, 19 Dec 2012 16:52:09
Plain Text |
Thanks! Simple, stable and useful.

Annotation: lkdfji

Author: gh
Mode: factor
Date: Thu, 8 May 2014 18:39:37
Plain Text |
i hav implemented this program but its not correct

New Annotation

Summary:
Author:
Mode:
Body: