Skip to content

Commit

Permalink
Change from unit="1" to unit="" to avoid unit issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Oct 11, 2021
1 parent 24f556f commit 203a716
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Modelica/Electrical/Batteries/BaseClasses/BaseCellStack.mo
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ partial model BaseCellStack
Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor
annotation (Placement(transformation(extent={{-90,10},{-70,-10}})));
Blocks.Continuous.LimIntegrator limIntegrator(
final k=1/(Np*cellData.Qnom),
final k(unit="")=1/(Np*cellData.Qnom),
outMax=1 - SOCtolerance,
outMin=SOCtolerance,
final initType=Modelica.Blocks.Types.Init.NoInit) annotation (
Expand All @@ -29,7 +29,7 @@ partial model BaseCellStack
final smoothness=cellData.smoothness,
extrapolation=Modelica.Blocks.Types.Extrapolation.HoldLastPoint)
annotation (Placement(transformation(extent={{-70,40},{-50,60}})));
Modelica.Blocks.Math.Gain gainV(final k=Ns*cellData.OCVmax) annotation (
Modelica.Blocks.Math.Gain gainV(final k(unit="")=Ns*cellData.OCVmax) annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ partial model BaseCellWithSensors "Partial cell with sensors"
Modelica.Electrical.Analog.Sensors.MultiSensor multiSensor
annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
Modelica.Blocks.Continuous.LimIntegrator limIntegrator(
k=1/cellData.Qnom,
k(unit="")=1/cellData.Qnom,
outMax=1 - SOCtolerance,
outMin=SOCtolerance,
initType=Modelica.Blocks.Types.Init.InitialOutput,
Expand Down
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(unit="")=1/Ti) annotation (Placement(transformation(extent={{30,10},{10,30}})));
Modelica.Electrical.Analog.Basic.Ground groundMotor annotation (Placement(
transformation(
extent={{-10,10},{10,-10}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ block LimitedPI

Modelica.Blocks.Math.Add addAntiWindup(k1=1, k2=-1/k)
annotation (Placement(transformation(extent={{-50,-30},{-30,-10}})));
Modelica.Blocks.Continuous.Integrator integrator(k=1/Ti, initType=Modelica.Blocks.Types.Init.NoInit) if useI
annotation (Placement(transformation(extent={{-20,-30},{0,-10}})));
Modelica.Blocks.Continuous.Integrator integrator(k(unit="")=1/Ti, initType=Modelica.Blocks.Types.Init.NoInit)
if useI annotation (Placement(transformation(extent={{-20,-30},{0,-10}})));
Modelica.Blocks.Math.Add3 add3(
k1=k,
k2=k,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ partial model PartialControlledDCPM
origin={30,80})));
LimitedPI currentController(
constantLimits=false,
k=driveData.kpI,
k(unit="")=driveData.kpI,
Ti=driveData.TiI,
KFF=driveData.kPhi,
KFF(unit="")=driveData.kPhi,
initType=Modelica.Blocks.Types.Init.InitialOutput,
useFF=true)
annotation (Placement(transformation(extent={{-50,-20},{-30,0}})));
Modelica.Blocks.Math.Gain tau2i(k=1/driveData.kPhi) annotation (Placement(
Modelica.Blocks.Math.Gain tau2i(k(unit="")=1/driveData.kPhi) annotation (Placement(
transformation(
extent={{10,-10},{-10,10}},
rotation=180,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ model DCPM_CurrentControlled
annotation (Placement(transformation(extent={{-20,50},{0,70}})));
Blocks.Continuous.LimPID PID(withFeedForward=true, initType=Modelica.Blocks.Types.Init.InitialOutput,
controllerType=Modelica.Blocks.Types.SimpleController.PI,
k=k,
k(unit="")=k,
Ti=Ti,
yMax=dcpmData.VaNominal,
kFF=kPhi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ block VoltageToAngle "Reference voltage to firing angle converter"
max=pi,
start=pi) "Firing angle"
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
Modelica.Blocks.Math.Gain gain_v(final k=1/VNominal)
Modelica.Blocks.Math.Gain gain_v(final k(unit="")=1/VNominal)
annotation (Placement(transformation(extent={{-80,-10},{-60,10}})));
Modelica.Blocks.Nonlinear.Limiter limiter(final uMax=1, final uMin=0)
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ model SMPM_FieldWeakening
ExampleUtilities.FieldWeakeningController fieldWeakeningController(VNominal=
VNominal, IMax=INominal)
annotation (Placement(transformation(extent={{-40,30},{-20,50}})));
Blocks.Math.Gain gainCurrent(k=INominal)
Blocks.Math.Gain gainCurrent(k(unit="")=INominal)
annotation (Placement(transformation(extent={{-70,30},{-50,50}})));
Blocks.Math.Gain gainSpeed(k=wNominal)
Blocks.Math.Gain gainSpeed(k(unit="")=wNominal)
annotation (Placement(transformation(extent={{-70,-90},{-50,-70}})));
Blocks.Sources.Ramp iqRef(
height=1,
Expand Down
3 changes: 2 additions & 1 deletion Modelica/Mechanics/Translational/Components/Vehicle.mo
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public
extent={{-10,-10},{10,10}},
rotation=90,
origin={60,-60})));
Blocks.Math.Gain gravForceGain(final k=-m*g) annotation (Placement(transformation(
Blocks.Math.Gain gravForceGain(final k(unit="")=-m*g)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
origin={20,30})));
protected
Expand Down
2 changes: 1 addition & 1 deletion Modelica/Mechanics/Translational/Examples/Vehicle.mo
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ model Vehicle "One-dimensional vehicle with driving resistances"
annotation (Placement(transformation(extent={{0,-10},{20,10}})));
Rotational.Sources.Torque torque1
annotation (Placement(transformation(extent={{0,40},{20,60}})));
Modelica.Blocks.Math.Gain gain(k=(fDrag + fRoll + fGrav)*R)
Modelica.Blocks.Math.Gain gain(k(unit="")=(fDrag + fRoll + fGrav)*R)
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
Blocks.Math.Gain gain1(k=2)
annotation (Placement(transformation(extent={{-10,-10},{10,10}},
Expand Down
2 changes: 1 addition & 1 deletion Modelica/Thermal/FluidHeatFlow/Examples/WaterPump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ model WaterPump "Water pumping station"
amplitude=1.2) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
origin={-70,-50})));
Modelica.Blocks.Math.Gain gain(k=idealPump.wNominal)
Modelica.Blocks.Math.Gain gain(k(unit="")=idealPump.wNominal)
annotation (Placement(transformation(extent={{-50,-60},{-30,-40}})));
Modelica.Mechanics.Rotational.Sources.Speed speed(exact=true)
annotation (Placement(transformation(extent={{-20,-60},{0,-40}})));
Expand Down

0 comments on commit 203a716

Please sign in to comment.