Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON CODE: Consider the equation X 4 = X 3 +10. [a,b]= [2,3] Write a PYTHON code to find the number of steps of Bisection

PYTHON CODE: Consider the equation X4= X3+10.

[a,b]= [2,3]

Write a PYTHON code to find the number of steps of Bisection method are required to calculate the solution within 10-10. Use a for loop.

CODE SO FAR: (not right):

#!/usr/bin/python import math

#Interval is [2,3] # tolerance is 10^-10 = 0.0000000001 # f(x) is x^4-x^3 - 10

a=2.0 b=3.0 y = 0.0 c = 0.0 count = 1 for i in range(10000000): count = count+1 c = (a+b)/2.0 y = (math.pow(a,4)-math.pow(a,3) - 10) * (math.pow(c,4)-math.pow(c,3) - 10) print(y) if abs(y) < 0.0000000001: break if y > 0: a = c if y < 0: b = c

print(count)

(answer should be 33 or 34)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

=+j on to staff their operations in the global marketplace.

Answered: 1 week ago