Question

In: Computer Science

PLEASE USE PYTHON CODE 2. Find the smallest positive (real) root of x^3-3.23x^2-5.54x+9.84 = 0 by...

PLEASE USE PYTHON CODE

2. Find the smallest positive (real) root of x^3-3.23x^2-5.54x+9.84 = 0 by the method of bisection

Solutions

Expert Solution

source code:


def func(x):
return (x*x*x) - (3.23*x*x) -(5.54*x) + 9.84

# Prints root of func(x)
# with error of EPSILON
def bisection(a,b):
  
if (func(a) * func(b) >= 0):
print("You have not assumed right a and b\n")
return

c = a
while ((b-a) >= 0.01):
  
# Find middle point
c = (a+b)/2

# Check if middle point is root
if (func(c) == 0.0):
break

# Decide the side to repeat the steps
if (func(c)*func(a) < 0):
b = c
else:
a = c
  
print("The value of root is : ","%.4f"%c)
  
# Driver code
# Initial values assumed
a =-200
b = 300
bisection(a, b)


Related Solutions

Find the smallest positive integer x that satisfies the system of congruences x ≡ 3 (mod...
Find the smallest positive integer x that satisfies the system of congruences x ≡ 3 (mod 5). x ≡ 5 (mod 7). x ≡ 7 (mod 11)
Use Newton-Raphson to find the real root to five significant figures 64x^3+6x^2+12-1=0
Use Newton-Raphson to find the real root to five significant figures 64x^3+6x^2+12-1=0
find real solutions : x^3+6x^2-6=0
find real solutions : x^3+6x^2-6=0
Use the secant Method to find a root for the function: f(x) = x^3 + 2x^2...
Use the secant Method to find a root for the function: f(x) = x^3 + 2x^2 + 10x -20, with x_0 = 2, and x_1 = 1.
GIVEN: COS(x) +3xe^-x=0 USING NEWTON RAPHSON METHOD Find: 1.) The POSITIVE ROOT USING X0=2 2.) THE...
GIVEN: COS(x) +3xe^-x=0 USING NEWTON RAPHSON METHOD Find: 1.) The POSITIVE ROOT USING X0=2 2.) THE NEGATIVE ROOT USING X0=-0.5 *STOPPING CRITERION ≤ 0.01% use radian mode in calcu and i dont want a program answers pls i need the manual method.
Find the positive root of the equation x^3-×-11 using inspection method.
Find the positive root of the equation x^3-×-11 using inspection method.
use bisection to find the real root x = sin(x) + 1 with the initial guesses...
use bisection to find the real root x = sin(x) + 1 with the initial guesses of x l = 0 and x u = 3. perform the computation until the approximate error falls below 5%
Write a Python program to find the smallest positive integer that is a perfect square and...
Write a Python program to find the smallest positive integer that is a perfect square and it contains exactly three different digits.
In Sciland code, use the Newton Method to find the root of f(x)=10-x^2 and tol =10^-5
In Sciland code, use the Newton Method to find the root of f(x)=10-x^2 and tol =10^-5
USING BISECTION METHOD, FIND THE ROOT OF 0.5e^x - 5x + 2 = 0 ON THE...
USING BISECTION METHOD, FIND THE ROOT OF 0.5e^x - 5x + 2 = 0 ON THE INTERVAL [ 0 , 1 ] UP TO 3 DECIMAL PLACES. USE NEWTON'S METHOD TO APPROXIMATE THE ROOT OF f(x)=x^2-5    IN THE INTERVAL  [ 2 , 3 ] UP TO 4 DECIMAL PLACES.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT