Question: 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
Get step-by-step solutions from verified subject matter experts
