i am geting error in this line why Error: File: dfdddd.m Line: 32 Column: 89 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

1 Ansicht (letzte 30 Tage)
% M-file: torque_speed_curve.m
% M-file create a plot of the torque-speed curve of the
% induction motor of Example 7-5.
% First, initialize the values needed in this program.
r1 = 0.641; % Stator resistance
x1 = 1.106; % Stator reactance
r2 = 0.332; % Rotor resistance
x2 = 0.464; % Rotor reactance
xm = 26.3; % Magnetization branch reactance
v_phase = 460 / sqrt(3); % Phase voltage
n_sync = 1800; % Synchronous speed (r/min)
w_sync = 188.5; % Synchronous speed (rad/s)
% Calculate the Thevenin voltage and impedance from Equations
% 7-41a and 7-43.
v_th = v_phase * ( xm / sqrt(r1^2 + (x1 + xm)^2) );
z_th = ((j*xm) * (r1 + j*x1)) / (r1 + j*(x1 + xm));
r_th = real(z_th);
x_th = imag(z_th);
% Now calculate the torque-speed characteristic for many
% slips between 0 and 1. Note that the first slip value
% is set to 0.001 instead of exactly 0 to avoid divide-
% by-zero problems.
s = (0:1:50) / 50; % Slip
s(1) = 0.001;
nm = (1 - s) * n_sync; % Mechanical speed
% Calculate torque for original rotor resistance
for ii = 1:51
t_ind1(ii) =(3 * v_th^2 * r2)./((w_sync.*s(ii).*((r_th+(r2./s(ii)).^2 + (x_th+x2)^2));
end
% Calculate torque for doubled rotor resistance
% Plot the torque-speed curve
plot(nm,t_ind1,'Color','k','LineWidth',2.0);
hold on;
xlabel('\itn_{m}','Fontweight','Bold');
ylabel('\tau_{ind}','Fontweight','Bold');
title ('Induction Motor Torque-Speed Characteristic','Fontweight','Bold');
legend ('Original R_{2}','Doubled R_{2}');
grid on;
hold off;

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 26 Nov. 2020
t_ind1(ii) =(3 * v_th^2 * r2)./((w_sync.*s(ii).*((r_th+(r2./s(ii)).^2 + (x_th+x2)^2));
1 0 1 0 12 3 2 34 5 6 54 5 4 32
You have two more ( than you have )
  3 Kommentare
Steven Lord
Steven Lord am 26 Nov. 2020
x = ((1+2)
This isn't valid MATLAB code because it has more left parentheses ( than right parentheses ).
Your code has the same type of problem except instead of having one extra ( it has two. You need to determine, based on what you're trying to compute, which two of the ( are unmatched and so need to be deleted or need extra ) symbols added to match them.
Walter Roberson
Walter Roberson am 26 Nov. 2020
My guess would be
t_ind1(ii) =(3 * v_th^2 * r2)./(w_sync.*s(ii).*((r_th+(r2./s(ii)).^2 + (x_th+x2)^2)));

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by