Parse error at '='
Show older comments
Hey everyone,
I dunno what's wrong with this code, it displays this:
Error: File: der_MI.m Line: 23 Column: 8
The expression to the left of the equals sign is not a valid target for an assignment.
The codes are:
function pX=der_MI(t,X)
global R Lee Lrr Ler J V we cero Ide Sim
iae=X(1);ibe=X(2);ice=X(3);iar=X(4);ibr=X(5);icr=X(6);
wm=X(7);theta=X(8);
vae=sqrt(2)*V*sin(we*t);
vbe=sqrt(2)*V*sin(we*t-2*pi/3);
vce=sqrt(2)*V*sin(we*t-4*pi/3);
var=0;vbr=0;vcr=0;
ve=[vae;vbe;vce];vr=[var;vbr;vcr];v=[ve;vr];
ie=[iae;ibe;ice];ir=[iar;ibr;icr];ii=[ie;ir];
a=cos(theta);b=cos(theta+2*pi/3);c=cos(theta+4*pi/3);
Cic=[a,b,c;c,a,b;b,c,a];
L=[Lee,Ler*Cic;Ler*Cic',Lrr];
a=-sin(theta);b=-sin(theta+2*pi/3);c=-sin(theta+4*pi/3);
Cic=[a,b,c;c,a,b;b,c,a];
dL=[cero,Ler*Cic;Ler*Cic',cero];
pii = ...;
pwm = ...; %THIS IS WHERE IT SAYS THERE IS THE ERROR
ptheta = ...;
pX=[pii;pwm;ptheta];
end
And this is the main code:
% Modelo de la máquina de inducción en coordenas primitivas
clear all
clc
global R Lee Lrr Ler J V we cero Ide Sim
Re=0.02;Rr=0.03;Lde=0.1;Ldr=0.1;Lme=2;Lmr=2;Ler=2;J=800;
V=1;we=1; % parametros están en por unidad
% R = [Re,0,0,0,0,0;
% 0,Re,0,0,0,0;
% 0,0,Re,0,0,0;
% 0,0,0,Rr,0,0;
% 0,0,0,0,Rr,0;
% 0,0,0,0,0,Rr]
R=diag([Re,Re,Re,Rr,Rr,Rr]);
Sim=[1 -0.5 -0.5;-0.5 1 -0.5;-0.5 -0.5 1];
Ide=eye(3);
cero=zeros(3,3);
Lee=Lde*Ide+Lme*Sim;
Lrr=Ldr*Ide+Lmr*Sim;
t0=0; tf=2*377; % Tiempos en por unidad
X0=[0,0,0,0,0,0,0,0];%[iae(0) ibe(0) ice(0) iar(0) ibr(0) icr(0) wm(0) theta(0)
tic
[T,X]=ode23(@der_MI,[t0 tf],X0)
toc
iae=X(:,1);ibe=X(:,2);ice=X(:,3);
iar=X(:,4);ibr=X(:,5);icr=X(:,6);
wm=X(7);theta=X(8);
figure(1)
plot(T/377,X(:,7))
xlabel('tiempo [s]')
ylabel('w_m [pu]')
grid
for n=1:length(T)
ie=[iae(n);ibe(n);ice(n)];
ir=[iar(n);ibr(n);icr(n)];
dCic=... theta(n)
Te(n)==Ler*ie'*dCic*ir
end
figure(2)
plot(T,Te)
What do u think could be?
Answers (1)
Walter Roberson
on 29 Dec 2018
0 votes
the ... on the line above is continuation . So you effectively have
pii = pwm = ptheta = pX = [something]
1 Comment
Alberto Cadena Vaca
on 29 Dec 2018
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!