Solve problem 1 numerically, using both bisection and False Position methods. Us
ID: 3755612 • Letter: S
Question
Solve problem 1 numerically, using both bisection and False Position methods. Use a tolerance
of 0.001. Print the results(MATLAB)
1. Consider the nonlinear equation x)(a) -2 +1Explanation / Answer
>> format long >> eps_abs = 1e-5; >> eps_step = 1e-5; >> a = 0.0; >> b = 2.0; >> step_size = Inf; >> while (step_size >= eps_step || ( abs( f(a) ) >= eps_abs && abs( f(b) ) >= eps_abs ) ) c = (f(a)*b - f(b)*a)/(f(a) - f(b)); if ( f(c) == 0 ) break; elseif ( f(a)*f(c) < 0 ) step_size = b - c; b = c; else step_size = c - a; a = c; end end >> [a b] ans = 1.259915864579067 2 >> abs(f(a)) ans = 0.0000246934256663 >> abs(f(b)) ans = 6Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.