Problems with fsolve error
이전 댓글 표시
Hello, I'm trying to run this code:
%% BEMT Stepnieski
clear
close all
clc
%%
R=5.5;
n=100;
drdr=1/n;
drdr=[drdr:drdr:1];
dr=R/n;
r=R*drdr;
c=0.3;
rho=1.225;
theta_0=0.1396; %collective pitch [rad]
theta_twist=0.1396; %[rad]
theta_r=theta_0 - r.*theta_twist; %[rad]
b=4;
V_tip=205;
Omega=V_tip/R; % [rad/s]
%% Application of Momentum Theory
%Making the two thrusts equal and using fsolve
sigma=b.*c./(pi.*R);
Vc=8;
vr0=zeros(1,100);
phir=@(x) atan((x+Vc)./Omega.*r);
alpha_r=@(x) theta_r-atan((x+Vc)./Omega.*r);
Mr=@(x) sqrt((Omega.*r).^2+(x+Vc).^2)./340;
G=@(x) 2./pi.*acos(exp(b./2.*(1-drdr)./(drdr.*(atan((x+Vc)./Omega.*r)))));
F= @(x) 0.5.*2.*pi.*alpha_r(x).*((Omega.*r).^2).*rho.*b.*c.*dr - 4.*pi...
.*rho.*(Vc+x).*x.*r.*dr.*G(x);
[vr,fval]=fsolve(F,vr0)
but I get the following error:
Error using trustnleqn (line 28)
Objective function is returning undefined values at initial point. FSOLVE cannot continue.
Error in fsolve (line 397)
[x,FVAL,JACOB,EXITFLAG,OUTPUT,msgData]=...
Error in BEMT_Stepnieski (line 42)
[vr,fval]=fsolve(F,vr0)
Any idea to solve it?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!