How can i polt the negative values in my code?
Ältere Kommentare anzeigen
Hello im strugling to find a way to plot my code here
clc
clear
%Motor Parameters
V1 = 469.5;
nph = 3;
poles = 4;
fe = 60;
R1 = 0.9174;
X1 = 0.005473*2*pi*fe;
Xm = 0.1854*2*pi*fe;
X2 = 0.005473*2*pi*fe;
R2 = 0.6258;
%Calculating syncronus speed
omegas = 4*pi*fe/poles;
ns = 120*fe/poles;
%Stator thenvenin equivelent
Z1eq = 1i*Xm*(R1 + 1i*X1)/(R1 + 1i* (X1+Xm));
R1eq = real(Z1eq);
X1eq = imag(Z1eq);
V1eq = abs(V1*1i*Xm/(R1 +1i*(X1 + Xm)));
%Slip loop
for x = 1:200
s(x) = x/50;
rpm(x) = ns*(1-s(x));
I2 = abs(V1eq/(Z1eq + 1i*X2 + R2/(s(x))));
Tmech(x) = nph*(I2^2)*R2/(s(x)*omegas);
end
plot(Tmech,rpm)
xlabel('Tmech')
ylabel('rpm')
it is a torque-speed graph for a motor. i con not figure our how i can get negative values of x and always giving me Array indices must be positive integers or logical values.
Error in Speed_torqe_graphing (line 37) s(x) = x/50;
any help is really appreciated.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!