Question

1. This question concerns finding the roots of the scalar non-linear function f(x) = r2-1-sinx (1 mark) (b) Apply two iterati
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

f=@(x) x^2-x-sin(x);
fplot(f,[-1 2]);
grid on
xlabel('x');
ylabel('f(x)');

2.5 2 1.5 3 0.5 0 -0.5 -1 0.5 0.5 1.5 0 2

(b) and (c)

bisecton medhocl. 2. 2. 2. 2 2.4チ11 .6 2 3.41

(d)

tol=10^(-15);
syms x;
s(1)=2;
f= x^2-x-sin(x);
for n=1:1000
l1(n)=subs(f,s(n));
l2(n)=subs(diff(f),s(n));
s(n+1)=s(n)-l1(n)/l2(n);
if ( abs(s(n+1)-s(n)) < tol )
break;
end
end
fprintf('roots using NR method = %1.15f \n',s(end)');

OUTPUT:

roots using NR method = 1.617545286062255

Add a comment
Know the answer?
Add Answer to:
1. This question concerns finding the roots of the scalar non-linear function f(x) = r2-1-sinx (1...
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
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