Solve these nonlinear equations for the uknowns, the angle \"phi\" and \"s\" usi
ID: 2994596 • Letter: S
Question
Solve these nonlinear equations for the uknowns, the angle "phi" and "s" using the newton-raphson method.
I know this is how the m file is supposed to look, but I'm not sure how to implement using the above equations to solve for phi and s.
function [root,ea,iter] = newtraph(y,dy,x,et)
max_it=1000;
iter = 0;
% Modified secant iteration
while(1)
xold = x; % store previous guess 'xr' in 'xrold' to estimate error
% derivative estimation by fraction perturbation
x = xold - y(x)/dy(x); % Modified secant formula
iter = iter + 1; % update iteration index
if x ~=0
ea = abs((x-xold)/x)*100;
end % estimate approx relative error
if ea <= et
break
end;
if iter >= max_it
error('max iteration reached')
end; % check for convergence; if so, stop
end
root = x; % root value is set to the final value of the guess, once it is conveged
Explanation / Answer
we have
R sin (theta ) + L sin(phi) = H ....(1)
R cos(theta) + L cos(phi) =s....(2)
Multuply cos (theta ) to 1st eqn and sin(theta) to 2nd eqn and subtract .
We get
L( sin(phi)cos(theta) - cos(phi) sin(theta) ) = H cos(theta) - s sin(theta)
So
L sin( phi -theta ) =H cos(theta) - s sin(theta)
phi = arcsin ([H cos(theta) - s sin(theta)] /L) + theta (Theta is known value)
So basically now we have expressed phi interms of s
Now s =R cos(theta) + L cos(phi) ( from eqn 2)
So we have expressed phi in terms of phi.
Now simply call the above function you have built using this equation of phi and solve it to find the roots ..!!!