Numerical solution using Fixed point iteration and Newton-Raphson methods

Trying to solve for inflow ratio (Lambda) using fixed point iteration method and Newton-Raphson method. Also, trying to plot inflow ratio vs advance ratio(mu) for a series of angles attack(alpha), but I cant have both graphs on the same plot, can't figure out where to put the hold on and hold off commands. Also, the two methods should give very close answers but Newton Raphson is not converging for some reason.
Below is my code, I would appreciate the feedback on what I can change to make this code work.
%%
It_Max=15;
error=100;
tol=1e-5;
It=1;
Vstream=50; %ft/s
Vtip=600; %ft/s
Ct=0.0075;
lambda_old=sqrt(Ct/2);
alpha=2:1:16
while error>tol && It<It_Max
mu=(Vstream*cosd(alpha))/(Vtip);
lambda_New=mu.*tand(alpha)+Ct./(2*sqrt(mu.^2+lambda_old));
error=abs((lambda_New-lambda_old)/(lambda_New));
lambda_old=lambda_New;
It=It+1;
plot(mu,lambda_New,'b*--')
%
hold on
f_lambda= lambda_old-mu.*tand(alpha)-((Ct)./(2*sqrt(mu.^2+lambda_old)))
f_lambdaPrime=1+(Ct/2).*(((mu.^2)-(lambda_old).^2).^1.5).*lambda_old
lambda_New=lambda_old - (f_lambda/f_lambdaPrime)
error=abs((lambda_New-lambda_old)/(lambda_New));
lambda_old=lambda_New;
It=It+1;
plot(mu,lambda_New,'k*--')
xlabel('Advanced Ratio')
ylabel('Inflow Ratio')
title('Inflow Ratio Vs Adavnced Flow Ratio')
hold off
end

Answers (1)

Hello
Did you find a solution? because I have the same work to do and I don't know how to do it.
Have a nice day

Products

Release

R2020b

Asked:

on 4 Sep 2021

Answered:

on 26 Apr 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!