

%Matlab code for Newton Method
clear all
close all
syms h
%function for which root have to find
r=2; l=5;
fun(h)=(r^2*acos((r-h)/r)+(h-r)*sqrt(2*r*h-h^2))*l-8;
g1(h) =diff(fun,h); %1st Derivative of this
function
xx=1.5;
%initial guess]
%function for Newton method
fprintf('Function for Newton method f(h)=\n')
disp(vpa(fun,3))
fprintf('\nDerivative of the function is df/dh=\n')
disp(vpa(g1,3))
fprintf('\nUsing Newton iterations\n')
%Loop for all intial guesses
n=0.0001; %error limit for close
itteration
for i=1:500 %maximum iterations
x2=double(xx-(fun(xx)./g1(xx))); %Newton Raphson Formula
cc=abs(x2-xx);
%Relative Error
err(i)=cc;
xx=x2;
fprintf('\nAfter %d
iteration\n',i)
fprintf('Value of
h=%f\n',xx)
fprintf('Function value
is %f\n',fun(xx))
fprintf('Derivative of
the function %f\n\n',g1(xx))
if cc<=n
break
end
end
root=xx;
fprintf('\n\tDepth h of the liquid is %f m\n',root)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
is O1. The olume I of liquid in a hollow horizontal cylinder of radius r and length related to the depthh h of the l...
Question 9 10 pts A hollow cylinder of outer radius R = 14 cm and mass M = 100 g with moment of inertia about the center of mass Icom = MR2 starts from rest and moves down an incline tilted at an angle 0 = 38° from the horizontal. The center of mass of the cylinder has dropped a vertical distance h= 131 cm when it reaches the bottom of the incline. The coefficient of static friction between the...
. A submarine has a shape of a round cylinder with radius R and length h. It is fully submerged such that its axis is horizontal at depth d (and d > R). Find the total force of water pressure acting on the front of the submarine.