Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Reinitialization for a piecewise-defined DAE set of equations

1 visualización (últimos 30 días)
Nicolas Mira Gebauer
Nicolas Mira Gebauer el 19 de Oct. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I am trying to model an electrical thyristor, which has the following switching equations:
ON-status: Vak >= Vf & vg > Vgt; or when Iak > Il
OFF-status: Else
For this, I am modelling a piecewise function as follows:
sCond = piecewise(Vak >= Vf & vg > Vgt | Iak > Il, 1, 0);
So, when sCond is 1, the status is ON; and when sCond is 0, the status is OFF.
By having such piecewise-defined function, I can use it to multiply it in my electric system's equations, which are strategically defined so that when sCond = 1, I will obtain a DAE system for the ON topology, and when sCond = 0, I will obtain a different DAE system which represents the OFF topology.
e =
piecewise(1/10000 < i_L2(t) | 0 <= u_KL1(t) - u_KL2(t), (50*sin(100*pi*t))/pi + i_L1(t)/(100*pi) + (91*i_L2(t))/(100*pi) - (20*u_KL1(t))/pi + (10*u_KL2(t))/pi, (50*sin(100*pi*t))/pi + i_L1(t)/(100*pi) - (10*u_KL1(t))/pi)
piecewise(1/10000 < i_L2(t) | 0 <= u_KL1(t) - u_KL2(t), i_L3(t)/(10*pi) - (91*i_L2(t))/(100*pi) + (10*u_KL1(t))/pi - (20*u_KL2(t))/pi, i_L3(t)/(10*pi) - (91*i_L2(t))/(100*pi) - (20*u_KL2(t))/pi)
u_KL1(t) - i_L1(t)/1000 - 5*sin(100*pi*t)
piecewise(1/10000 < i_L2(t) | 0 <= u_KL1(t) - u_KL2(t), u_KL1(t) - (91*i_L2(t))/1000 - u_KL2(t), - (91*i_L2(t))/1000 - u_KL2(t))
u_KL2(t) - i_L3(t)/100
%Thus, when the sCond = 0, e would be:
L1*diff(i_L1(t), t) + RL1*i_L1(t) == u_KL1(t) - US*sin(phiS + 2*pi*f*t)
L2*diff(i_L2(t), t) + RL2*i_L2(t) == -u_KL2(t)
L3*diff(i_L3(t), t) + RL3*i_L3(t) == u_KL2(t)
u_KL1(t)/(2*L1*f*pi) == (US*sin(phiS + 2*pi*f*t))/(2*L1*f*pi) + (RL1*i_L1(t))/(2*L1*f*pi)
u_KL2(t)*(1/(2*L2*f*pi) + 1/(2*L3*f*pi)) == (RL3*i_L3(t))/(2*L3*f*pi) - (RL2*i_L2(t))/(2*L2*f*pi)
%Otherwise, when sCond = 1, e would be:
L1*diff(i_L1(t), t) + RL1*i_L1(t) == u_KL1(t) - US*sin(phiS + 2*pi*f*t)
L2*diff(i_L2(t), t) + RL2*i_L2(t) == u_KL1(t) - u_KL2(t)
L3*diff(i_L3(t), t) + RL3*i_L3(t) == u_KL2(t)
u_KL1(t)*(1/(2*L1*f*pi) + 1/(2*L2*f*pi)) - u_KL2(t)/(2*L2*f*pi) == (US*sin(phiS + 2*pi*f*t))/(2*L1*f*pi) + (RL1*i_L1(t))/(2*L1*f*pi) + (RL2*i_L2(t))/(2*L2*f*pi)
u_KL2(t)*(1/(2*L2*f*pi) + 1/(2*L3*f*pi)) - u_KL1(t)/(2*L2*f*pi) == (RL3*i_L3(t))/(2*L3*f*pi) - (RL2*i_L2(t))/(2*L2*f*pi)
It's all working well, except for one thing.
I am not being able to correctly reinitialize the variables when an event is detected (when sCond changes from 0 to 1 or viceversa). In fact, my code is only works when I manually change the initial values at each event-reinitialization using the values that I previously know that should be consistent, but I need to do it automatically for when I expand my problem. Is there a formal way to do this? I tried using decic() by giving it the previous's step values but apparently it does not recognize that the DAE set of equations e is changing from ON to OFF, thus it tries to use these previous's step values and thus says that it needs a better guess.
  1 comentario
Nicolas Mira Gebauer
Nicolas Mira Gebauer el 20 de Oct. de 2020
I forgot to mention that the change of state (from ON to OFF) produces a discontinuity on the variables.

Respuestas (0)

La pregunta está cerrada.

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by