Skip to content

Commit

Permalink
Fix unit error in Thyristor
Browse files Browse the repository at this point in the history
Introduces a variable to resolve a unit error in an equation.
  • Loading branch information
qlambert-pro committed Apr 17, 2023
1 parent 10238e9 commit 5e3a19b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Modelica/Electrical/Analog/Semiconductors/Thyristor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ model Thyristor "Simple Thyristor Model"
SI.Voltage vControl(start=0);
SI.Voltage vContot;
SI.Voltage vConmain;
SI.Voltage vRef = 0.65;

public
Modelica.Electrical.Analog.Interfaces.PositivePin Anode annotation (Placement(transformation(extent={{-110,-10},{-90,10}})));
Expand All @@ -47,8 +48,8 @@ equation

// Gate and Control voltage
iGK = Gate.i;
vGK = smooth(0,(if vGK < 0.65 then VGT/IGT*iGK else
0.65^2/VGT+iGK*(VGT-0.65)/IGT));
vGK = smooth(0,(if vGK < vRef then VGT/IGT*iGK else
vRef^2/VGT+iGK*(VGT-vRef)/IGT));
vContot = vConmain + smooth(0, if iGK < 0.95 * IGT then 0 else if iGK < 0.95*IGT + 1e-3 then 10000*(iGK-0.95*IGT)*vAK else 10* vAK);
der(vControl)= (vContot - vControl) / (if (vContot - vControl) > 0 then 1.87*TON else 0.638*TOFF);

Expand Down

0 comments on commit 5e3a19b

Please sign in to comment.