Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

Describe recruitment and selection for international operations.

Answered: 1 week ago