Determine the real
root of f (x) = −25 + 82x − 90x2 + 44x3
−8x4 + 0.7x5:
Using python in bisection to determine the root to
s = 10%. Employ
initial guesses of xl = 0.5 and xu = 1.0;
pls use python
""" Python program for bisection method """ def func(x): return (0.7*(x**5) + -8*(x**4) + 44*(x**3) + -90*(x**2) + 82*x - 25) def bisection(xl,xu): if (func(xl) * func(xu) >= 0): print("Wrong choice for xl and xu") return x = xl while ((xu-xl) >= 0.10): # Find middle point x = (xl+xu)/2 # Check if middle point is root if (func(x) == 0.0): break # Decide the side to repeat the steps if (func(x)*func(xl) < 0): xu = x else: xl = x print("The value of root is : ", x) a = 0.5 b = 1 bisection(a, b)
Note: Drop comments, for queries.
Get Answers For Free
Most questions answered within 1 hours.