Muller’s method

Muller’s method :

ALGORITHM :

  1. Start of the program.
  2. Input the variables xi, xi1, xi2
  3. Input absolute error-aerr
  4. Repeat Steps 5-12, until |Xn-Xi| < aerr
  5. Yi = y(Xi)
  6. Yil = y(Xi1)
  7. Yi2 = y(Xi2)
  8. a = A(Xi, Xi1, Xi2, Yi, Yi1, Yi2)
  9. b = B(Xi, Xi1, Xi2, Yi, Yi1, Yi2);
  10. Xn = approx (Xi, Yi, a, b);
  11. Check loop condition
  12. if false, exit loop
  13. if true, do
    Xi = Xn
    increment i
    [end of while loop
  14. Print output
  15. End of program
  16. Start of section A
  17. take Xa, Xb, Xc, Ya, Yb, Yc
  18. x = ((Yb-Ya)*(Xc-Xa)-(Yc-Ya)*(Xb-Xa))/((Xb-Xa)*(Xc-Xa)*(Xb-Xc))
  19. Return x
  20. End of section A
  21. Start of section B
  22. Take Xa, Xb, Xc, Ya, Yb, Yc
  23. c = (((Yc-Ya)*pow((Xb-Xa),2))-((Yb-Ya)*pow((Xc-Xa),2)))/((Xb-Xa)*(Xc-Xa)*(Xb-Xc))
  24. Return c
  25. End of section B
  26. Start of section approx
  27. Take x, y, a, b
  28. c = sqrt(b*b-4*a*y)
  29. If (b + c) > (b-c): t = x-((2*y)/(b + c))
  30. Else: t = (x-((2*y)/(b-c)))
  31. Return t
  32. End of section approx
C SOURCE CODE :

OUTPUT :

Muller's method


Leave a Reply

Your email address will not be published. Required fields are marked *