Can you use python and show the codes? The second picture was an example in class and the codes used

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter14: Numerical Methods
Section14.3: Refinements To The Bisection Method
Problem 4E
icon
Related questions
Question
Can you use python and show the codes? The second picture was an example in class and the codes used
3. Problem 3: Find two roots of the equation
cos(x)e-2 sin(3 ln(x²)) = 0,
on the interval [4, 10]. Explain how many decimal places you believe
you have correct, and how many steps of the bisection method it took.
Also include timing results for your calculations.
Transcribed Image Text:3. Problem 3: Find two roots of the equation cos(x)e-2 sin(3 ln(x²)) = 0, on the interval [4, 10]. Explain how many decimal places you believe you have correct, and how many steps of the bisection method it took. Also include timing results for your calculations.
8.8
2
3
10
4
5
6
7
8
9
10
11
12
A 13
14
#Wand a root of f(x) = cos(x) = x
left = 0
right = math.pi/2
f_left = math.cos(left)-left
f_right = math.cos(right) right
for n in range(0, 20):
mid = (left + right)/2
f_mid= math.cos(mid)-mid
Transcribed Image Text:8.8 2 3 10 4 5 6 7 8 9 10 11 12 A 13 14 #Wand a root of f(x) = cos(x) = x left = 0 right = math.pi/2 f_left = math.cos(left)-left f_right = math.cos(right) right for n in range(0, 20): mid = (left + right)/2 f_mid= math.cos(mid)-mid
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr