Filter löschen
Filter löschen

not geting the plot and my loop is not working

2 Ansichten (letzte 30 Tage)
Sourav singh
Sourav singh am 12 Mär. 2021
Kommentiert: Sourav singh am 13 Mär. 2021
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');

Akzeptierte Antwort

Mathieu NOE
Mathieu NOE am 12 Mär. 2021
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');

Weitere Antworten (1)

Alan Stevens
Alan Stevens am 12 Mär. 2021
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 Kommentare
Alan Stevens
Alan Stevens am 12 Mär. 2021
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.
Sourav singh
Sourav singh am 13 Mär. 2021
thank u sir

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by