Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer ONLY C AND D USE PYTHON Question 1 50 marks Consider the nonlinear equation f(x) = sin(1x) x2 = 0) (a) Can you

Please answer ONLY C AND D USE PYTHON

image text in transcribed

Question 1 50 marks Consider the nonlinear equation f(x) = sin(1x) x2 = 0) (a) Can you solve the equation by hand, i.e. express the solution x* explicitly in terms of elementary functions and the constant it? (b) Show that the equation f(x) = 0 has the same solution(s) as g(x) = x if 9(z) = 2* sin(72) - 2222 + In fact, we can show that for any initial point in (0, 2] the sequence xk = g(xk-1) converges to a unique solution x*. ite a function that computes this sequence. Your function should: Take for input the an initial point, a maximal number of iterations and a tolerance for |2k Xk-1| (the estimated error) and for \f (xk)| (the residual). Print to the commend window the list of iterates, stopping when either the maximal number of iterations is reached or the estimated error and the residual are below their respective tolerance. Output the approximate solution, its estimated error and its residual. (d) If you used a for or while loop in (c), program a function with the same functionality using recursion (i.e. no explicit loops). If you used recursion in (c) then program a function with the same functionality using loops (i.e. no recursion). Name your functions iteration.m for the version with a loop and recursion.m for the version without

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

International Baccalaureate Computer Science HL And SL Option A Databases Part I Basic Concepts

Authors: H Sarah Shakibi PhD

1st Edition

1542457084, 978-1542457088

More Books

Students also viewed these Databases questions