Question

MATLAB

Given a table like this one: i xLeft xRightyLeftyRight xNew yNew 3 8.75 10.000 173.05 -200.0. 9.3750 -12.7441 4 8.75 9.3750 1

0 0
Add a comment Improve this question Transcribed image text
Answer #1

part 1)

x_left = 9.0625

x_right = 9.3750

we are trying to minimize the interval for searching of solution by bisection method and simultaneously find and reduce the mid which is x_new to zero, so from the given table we can deduce the above x_left and x_right.

part2)

CODE

function [out] = myNewton(f,x0, tol)

%initial high error
err=1;
syms x
%calculating differentiation
df = eval(['@(x)' char(diff(f(x)))])


while err > tol
del= -f(x0)/df(x0);   
x0=x0 +del ; %using newton - raphsn method
err= abs(del/x0); %calulating error in each iteration
end

out = x0;

end

SCREENSHOTS

function [out] = myNewton (f,x0, tol) tinitial err=1; high error calculating differentiation df eval( (x)char (diff (f (x)))

Please go through above code and explanation and if any doubts then comment.

Give me a thumbs up . Thanks.

Add a comment
Know the answer?
Add Answer to:
MATLAB Given a table like this one: i xLeft xRightyLeftyRight xNew yNew 3 8.75 10.000 173.05 -200.0. 9.3750 -12.7441 4 8.75 9.3750 173.05 -12.74 9.0625 80.4260 On iteration 5 of Bisection, what is xL...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I'm working on the newton's method on matlab, could someone help me and show what two...

    I'm working on the newton's method on matlab, could someone help me and show what two lines are needed to be added in the codes in order to make this function work? function sample_newton(f, xc, tol, max_iter) % sample_newton(f, xc, tol, max_iter) % finds a root of the given function f over the interval [a, b] using Newton-Raphson method % IN: % f - the target function to find a root of % function handle with two outputs, f(x), f'(x)...

  • Programming Language: MATLAB Problem 3: (5 Points) Write a function with the header: function [R] -myNewtonRaphson...

    Programming Language: MATLAB Problem 3: (5 Points) Write a function with the header: function [R] -myNewtonRaphson (f, fp, x0, tol) which takes as input f: a function handle fp: a function handle to the derivative of f (note how I do it in the test case). x0: the initial guess of the root tol: a tolerance above which the algorithm will keep iterating. Tips: . Be sure to include an iteration counter which will stop the while-loop if the number...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT