1use Dichotomy Find Real Root Section 0 1 However Tolerance 001 1 Implementing Python 2 Q37103504

1.Use the dichotomy to find the real root of f(x)=x ^{5} +3x-1 in the section (0,1). However, the tolerance should be 0.01%.

1) Implementing Python
2) Comparing calculation result dichotomy with Newton method
3) To check the relationship between the actual value and thecalculation results
4) Actual values are obtained with Python and compared with resultsusing two algorithms

Thank you. 🙂


Solution


Please find required python code below:

import numpy as np
from scipy.optimize import fsolve

#=============================================================================

def func(x):
return x**5 + 3*x -1

# Derivative of the above function
def derivFunc( x ):
return 5 *x**4 +3

#=============================================================================
# Prints root of func(x)
def bisection(a,b):
  
if (func(a) * func(b) >= 0):
print(“You have not assumed

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.