Skip to content

Commit

Permalink
Avoid unit error.
Browse files Browse the repository at this point in the history
Adding a protected element in an example model should be ok.
  • Loading branch information
HansOlsson committed Sep 30, 2022
1 parent cf30cb7 commit 97905bb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ model IdealDcDc "Ideal DC-DC inverter"
Modelica.Blocks.Continuous.Integrator powerController(
initType=Modelica.Blocks.Types.Init.InitialOutput,
y_start=0,
k=1/Ti) annotation (Placement(transformation(extent={{30,10},{10,30}})));
k=1/Ti/unitVoltage) annotation (Placement(transformation(extent={{30,10},{10,30}})));
Modelica.Electrical.Analog.Basic.Ground groundMotor annotation (Placement(
transformation(
extent={{-10,10},{10,-10}},
Expand All @@ -45,6 +45,8 @@ model IdealDcDc "Ideal DC-DC inverter"
annotation (Placement(transformation(extent={{90,-112},{110,-92}})));
Modelica.Blocks.Interfaces.RealInput vRef
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
protected
constant SI.Voltage unitVoltage=1 annotation(HideResult=true);
equation
connect(signalCurrent.p, powerBat.nc)
annotation (Line(points={{10,70},{20,70}}, color={0,0,255}));
Expand Down

0 comments on commit 97905bb

Please sign in to comment.