not geting the plot and my loop is not working
1 次查看(过去 30 天)
显示 更早的评论
sigma=0.047193;
V_tip=180;
W=180;
Cd_avg=0.01;
R=2.235;
Rv=80.529; %rotational velocity
A=pi*R.^2;
rho=1.225;
for Ct=0.004:0.0001:0.005
Vs=-(sqrt(Ct./2)+((sigma*Cd_avg)./(8*Ct))).*(Rv*R); %descent speed
Cd_eq=((2*W)./(rho.*A.*(Vs).^2)); % equivalent drag coefficient of the rotor in steady descent
end
hold on
plot(Ct,Cd_eq,'r');
0 个评论
采纳的回答
Mathieu NOE
2021-3-12
hello
consider indexing your variables
sigma=0.047193;
V_tip=180;
W=180;
Cd_avg=0.01;
R=2.235;
Rv=80.529; %rotational velocity
A=pi*R.^2;
rho=1.225;
Ct=0.004:0.0001:0.005;
Cd_eq = zeros(1,length(Ct));
for ci = 1:length(Ct)
Cti = Ct(ci);
Vs=-(sqrt(Cti./2)+((sigma*Cd_avg)./(8*Cti))).*(Rv*R); %descent speed
Cd_eq(1,ci)=((2*W)./(rho.*A.*(Vs).^2)); % equivalent drag coefficient of the rotor in steady descent
end
plot(Ct,Cd_eq,'r');
0 个评论
更多回答(1 个)
Alan Stevens
2021-3-12
Needs to be as follows:
sigma=0.047193;
V_tip=180;
W=180;
Cd_avg=0.01;
R=2.235;
Rv=80.529; %rotational velocity
A=pi*R.^2;
rho=1.225;
Ct = 0.004:0.0001:0.005;
for i = 1:numel(Ct)
Vs=-(sqrt(Ct(i)./2)+((sigma*Cd_avg)./(8*Ct(i)))).*(Rv*R); %descent speed
Cd_eq(i)=((2*W)./(rho.*A.*(Vs).^2)); % equivalent drag coefficient of the rotor in steady descent
end
hold on
plot(Ct,Cd_eq,'r');
3 个评论
Alan Stevens
2021-3-12
i is a commonly used index counter, but it is arbitrary and you can use whatever you like.
You can also have Vs(i) if you wish, then all values of Vs are available at the end of the loop. However, your original code only had Cd_eq being plotted, so that was the only one I put the i into.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!