Menu

(Solved) : Im Issues Python Program Wont Display Answer Want Perform Bisection Method Show Roots Well Q43925836 . . .

Im having issues with my python program. It wont display an answer. I want to perform the bisection method and show roots as well as show answer on a graph. I have no idea why it is not working. Thank you in advance.def f(x): return x**3 + 1def bisection (a,b,tol): xl = a xr = b while(np.abs(xl-xr))=tol: c=(xl+xr)/2.0 prod=f(xl)*f(c) if prod>tol: xl=c else prod<tol: xr=c return canswer = bisection (-10,10,1e-8) print (“Bisection Method finds Root at x= “(answer))x= np.linspace (-10,10,100)plt.plot(x,f(x))plt.grid()plt.show()

Expert Answer


Answer to Im having issues with my python program. It wont display an answer. I want to perform the bisection method and show roo…

OR