StrayLoad loss model in MSL.Electrical.Machines, speeds that cross zeros #2184
Labels
bug
Critical/severe issue
L: Electrical.Machines
Issue addresses Modelica.Electrical.Machines
L: Magnetic.QuasiStatic
Issue addresses Modelica.Magnetic.QuasiStatic
Milestone
Model:
Modelica.Electrical.Machines.Losses.InductionMachines.StrayLoad
Problem descritpion:
Picking a parameter "power_w" that is not a full number (in my case I chose 0.4) gives problems when the speed is going through zero during simulation.
Possible fix:
A possible fix seems to be the addition of a noEvent additionally to the smooth operator. Could be e.g. the following:
if (strayLoadParameters.PRef <= 0) then
tau = 0;
else
tau = -strayLoadParameters.tauRef*(iRMS/strayLoadParameters.IRef)^2*
smooth(1, noEvent(if w >= 0) then +(+w/strayLoadParameters.wRef)^strayLoadParameters.power_w
else -(-w/strayLoadParameters.wRef)^strayLoadParameters.power_w);
end if;
The combination of smooth + noEvent can be discussed of course, but as a proof-of-concept it seems to work fine for me.
The text was updated successfully, but these errors were encountered: