Question

Computational Homework Problem #1 In class, the relationship between arc length s, length L, and included angle 0, were deriv
0 0
Add a comment Improve this question Transcribed image text
Answer #1

We need to solve the following equation to find the root \theta using the Newton-Rapson method.

f(0)0-sin0 0

The iterative formula for the Newton-Rapson method can be given as:

9(i1)i)- f(0.) f(0 )

MATLAB code:

%%%%% root finding using the newton rhapson method
clc; clear;
s = 5281.716; % ft
L = 5280; % ft
syms x;
f = x - (s/L)*sin(x); %Given Function
g = diff(f,x); %The derivative of the function
i = 1;
err = 1;
theta(1) = 10; %the intial approximation
R(1) =s/(2*theta(1)); % intial value of R
d(1) = R(1)*(1-cos(theta(1))); % initial value of d
while err > 10^-8
theta(i+1)=theta(i)-subs(f,x,theta(i))/subs(g,x,theta(i)); % formula of the method
err = abs(theta (i+1) - theta (i)); % error after each iteration
R(i+1) = s/(2*theta(i+1)); % Radius after each iteration
d(i+1) = R(i+1)*(1-cos(theta(i+1))); % height after each iteration
i =i+1;
end
fprintf('The final value of theta is : %f \n',theta(i));
fprintf('No. of Iterations : %d\n',i-1);

Output of the Code:

Editor - CAUsers khantwallDesktop\Matlab Chegg Newton Rhapson.m pressuredrop.m regressioneqs.mx rungekutta1.m Current Folder

The Table containing the values of \theta, R and d after each iteration

theta 10 4.26741457 0.65325189 0.4330393 0.28880102 0.19378583 0.1313902 0.09099833 0.06582614 0.05162548 0.04551466 0.044212

Add a comment
Know the answer?
Add Answer to:
Computational Homework Problem #1 In class, the relationship between arc length s, length L, and included...
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
Active Questions
ADVERTISEMENT