language simscape

2 views (last 30 days)
Rafael Araújo
Rafael Araújo on 8 May 2012
language simscape
I'm having difficulty build a model of an inductor in simscape actually the model already built, but this error occurring in the simulation, the following error appears: "Number of equations Exceeds number of variables," what should I do to fix this ?
follows the code of the inductor:
component indutorhisterese < foundation.electrical.branch
%indutorhisterese
parameters
N = 700;%Número de espiras
R = { 0.6914, 'Ohm' }; %Resistência interna
lm = {1,'m'}; %lm
A = {105e-6,'m^2'};%Área do núcleo
alfa = 50e-6;%admensional He=H+alfa*M correção de Weiss para o ferromagnetismo, parâmetro da equação de Langevin
Ms = {1.63e6,'A/m'}; %Magnetização de saturação, parâmetro da
equação de Langevin
aa = {60,'A/m'};
uo = {4*pi*1e-7,'H/m'};
k = {52,'A/m'}% k=n*Ep, números de pontos de grampeamento vs a energia média para superá-los;
c = 0.1;%admensional
end
variables
B = {0,'(H*A)/m^2'};
H = {0,'A/m'};
He = {0,'A/m'};
iM = {0;'A/m'}; %iM=M não pode-se começar variaveis com M ou L
Man = {0;'A/m'};
Mir ={0;'A/m'};
delta=0;% parâmetro direcional tal que delta=+1 para dH/dt>0, no ramo ascendente do laço e delta=-1 para dH/dt<0, no ramo
descendente do laço.
dMandHe=0;
dMdB={0,'m/H'};
dMirdBe={0,'m/H'};
end
function setup
B=0;
iM=0;
end
equations
B=={1,'(H*A)/m^2'}*sin(2*pi*time);
if B.der<0
delta==-1;
else
delta==+1;
end
iM == (B/uo)-H;
He==(H+alfa*iM);
if(abs((He)/aa) < 0.1 )
Man==Ms*He/(3*aa);
dMandHe==Ms/(3*aa);
else
Man == Ms*((1/tanh(He/aa))-(aa/He));
dMandHe == (Ms/aa)*(1-(1/tanh((He/aa))^2 + (aa/He)^2));
end
Mir==((iM-c*Man)/(1-c));
dMirdBe==[Man-Mir]/[uo*k*delta];
if dMirdBe <0
dMdB == ((c*dMandHe/uo))/(1 + c*(1-alfa)*dMandHe);
else
dMdB == ((1-c)*dMirdBe + (c*dMandHe/uo))/(1 + c*dMandHe*(1-alfa) + uo*(1-alfa)*(1-c)*dMirdBe );
end
(iM + {1,'s'}*iM.der)==iM + dMdB*({1,'s'}*B.der);
(H + {1,'s'}*H.der)==(B + {1,'s'}*B.der)/uo-(iM + {1,'s'}*iM.der);
i == H*lm/N;
v == R*i + N*A*B.der;
end
end
in constructing the model no errors occur, but perhaps not an error occurs in the structure of language, but occurs in logic programming.
Thanks.
  1 Comment
Kaustubha Govind
Kaustubha Govind on 9 May 2012
I don't have any experience with SimScape, but I thought it might help you to look at the discussion here: http://www.mathworks.com/matlabcentral/newsreader/view_thread/287037

Sign in to comment.

Answers (0)

Categories

Find more on Equations in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!