Skip to content

Commit

Permalink
Time events instead of state events
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Jan 10, 2024
1 parent e20081a commit 3e25b29
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Modelica/Electrical/PowerConverters/DCAC/Control/SVPWM.mo
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ equation
//Distribute switching patterns t0/4 + ta/2 + tb/2 + t0/2 + tb/2 + ta/2 + t0/4
if time<startTime then
fire_p= fill(true, m);
elseif (time - T0)/samplePeriod < (t0/4) then
elseif time < T0 + samplePeriod * (t0/4) then
fire_p= fill(false, m);
elseif (time - T0)/samplePeriod < (t0/4 + ta/2) then
elseif time < T0 + samplePeriod * (t0/4 + ta/2) then
fire_p= fire[ka + 1, :];
elseif (time - T0)/samplePeriod < (t0/4 + ta/2 + tb/2) then
elseif time < T0 + samplePeriod * (t0/4 + ta/2 + tb/2) then
fire_p= fire[kb + 1, :];
elseif (time - T0)/samplePeriod < (t0/4 + ta/2 + tb/2 + t0/2) then
elseif time < T0 + samplePeriod * (t0/4 + ta/2 + tb/2 + t0/2) then
fire_p= fill(true, m);
elseif (time - T0)/samplePeriod < (t0/4 + ta/2 + tb/2 + t0/2 + tb/2) then
elseif time < T0 + samplePeriod * (t0/4 + ta/2 + tb/2 + t0/2 + tb/2) then
fire_p= fire[kb + 1, :];
elseif (time - T0)/samplePeriod < (t0/4 + ta/2 + tb/2 + t0/2 + tb/2 + ta/2) then
elseif time < T0 + samplePeriod * (t0/4 + ta/2 + tb/2 + t0/2 + tb/2 + ta/2) then
fire_p= fire[ka + 1, :];
else
fire_p= fill(false, m);
Expand Down

0 comments on commit 3e25b29

Please sign in to comment.