Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab Task 2: Complete the missing code of bisection method accordding to the explained algorithm and find root of given problems by bisection method according
Lab Task 2: Complete the missing code of bisection method accordding to the explained algorithm and find root of given problems by bisection method according to the instructions given in table. 1) 1(x)=cos(x)1.3x 2) f2(x)=xcos(x)2x2+3x1 3) f3(x)=2xcos(2x)(x+1)2 import numpy as np fram tabulate impart tabulate q* module Bisectian Finds a root of f(x)=0 by bisection. The root must be bracketed in (x,x2). def bigection (func, x1,x2, tol=0. D001, max_iter=100) : if func (x1) func (x2)>0=0 data =[] itar =0 xr=x2 crtor= tol +1 while itar tol: xrold =xr xr=({x1+x2)/2) iter +=1 crror=abs(xrxrold)) teat = func (x1) func (xr) t write your code here to replace value of x1 or x2 by xr data , append ([ iter +1,x1, fume (x1),x2, func (x2),xr, func (xr), error ]) return Task 2 (Bisection Method) Repeat the process by selecting another interval Repeat the process by selecting another interval Repeat the process by selecting another interval Write your Observations
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started