Skip to content

Commit

Permalink
Correct assert and white space fixes
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Beutlich <modelica@tbeu.de>
  • Loading branch information
dietmarw and beutlich committed Jan 18, 2022
1 parent 122aa76 commit 819f79b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modelica/Electrical/Analog/Sources/DCPowerSupply.mo
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ initial algorithm
end if;
equation
p.i + n.i = 0;
assert(v >= 0, "Only voltage > 0 allowed");
assert(v >= 0, "Only voltage >= 0 allowed");
assert(i <= iBack, "Back current exceeded!");
cv = (-i) <= iLim;
cc = v <= vLim;
if cp then
if cv then
if cv then
v = V0 - Rcv*(-i);
elseif cc then
-i = I0 - Gcc*v;
else// cp
P0 = v*(-i);
end if;
else
if cv then
if cv then
v = V0 - Rcv*(-i);
else//cc
-i = I0 - Gcc*v;
Expand Down

0 comments on commit 819f79b

Please sign in to comment.