By graphical method show that (x-1)^2 - ln(x)=0 has a unique root in (1,2). (x=1
ID: 3697944 • Letter: B
Question
By graphical method show that (x-1)^2 - ln(x)=0 has a unique root in (1,2).
(x=1 is also a root)
b) Which point 1 or 2 should you start from to make sure the convergence in Newton method?
c) Matlab: Check if Matlab has a function to find roots. If so find the roots of the function above.
Comment:
I need help with the Matlab part
Thank you
Explanation / Answer
x = 0.05; x_old = 100; x_true = 0.0623776; iter = 0; while abs(x_old-x) > 10^-3 && x ~= 0 x_old = x; x = x - (x^3 - 0.165*x^2 + 3.993*10^-4)/(3*x^2 - 0.33*x); iter = iter + 1; fprintf('Iteration %d: x=%.20f, err=%.20f ', iter, x, x_true-x); pause; end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.