Skip to content

Commit 97905bb

Browse files
committed
Avoid unit error.
Adding a protected element in an example model should be ok.
1 parent cf30cb7 commit 97905bb

File tree

1 file changed

+3
-1
lines changed
  • Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities

1 file changed

+3
-1
lines changed

Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/IdealDcDc.mo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ model IdealDcDc "Ideal DC-DC inverter"
2828
Modelica.Blocks.Continuous.Integrator powerController(
2929
initType=Modelica.Blocks.Types.Init.InitialOutput,
3030
y_start=0,
31-
k=1/Ti) annotation (Placement(transformation(extent={{30,10},{10,30}})));
31+
k=1/Ti/unitVoltage) annotation (Placement(transformation(extent={{30,10},{10,30}})));
3232
Modelica.Electrical.Analog.Basic.Ground groundMotor annotation (Placement(
3333
transformation(
3434
extent={{-10,10},{10,-10}},
@@ -45,6 +45,8 @@ model IdealDcDc "Ideal DC-DC inverter"
4545
annotation (Placement(transformation(extent={{90,-112},{110,-92}})));
4646
Modelica.Blocks.Interfaces.RealInput vRef
4747
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
48+
protected
49+
constant SI.Voltage unitVoltage=1 annotation(HideResult=true);
4850
equation
4951
connect(signalCurrent.p, powerBat.nc)
5052
annotation (Line(points={{10,70},{20,70}}, color={0,0,255}));

0 commit comments

Comments
 (0)