From 203a71646b7a359a33a385721de5cd85f97d9891 Mon Sep 17 00:00:00 2001 From: OLSSON Hans Date: Mon, 11 Oct 2021 14:29:02 +0200 Subject: [PATCH] Change from unit="1" to unit="" to avoid unit issues. Closes #3878 --- Modelica/Electrical/Batteries/BaseClasses/BaseCellStack.mo | 4 ++-- .../Electrical/Batteries/BaseClasses/BaseCellWithSensors.mo | 2 +- .../Examples/ControlledDCDrives/Utilities/IdealDcDc.mo | 2 +- .../Examples/ControlledDCDrives/Utilities/LimitedPI.mo | 4 ++-- .../ControlledDCDrives/Utilities/PartialControlledDCPM.mo | 6 +++--- .../Machines/Examples/DCMachines/DCPM_CurrentControlled.mo | 2 +- .../PowerConverters/ACAC/Control/VoltageToAngle.mo | 2 +- .../SynchronousMachines/SMPM_FieldWeakening.mo | 4 ++-- Modelica/Mechanics/Translational/Components/Vehicle.mo | 3 ++- Modelica/Mechanics/Translational/Examples/Vehicle.mo | 2 +- Modelica/Thermal/FluidHeatFlow/Examples/WaterPump.mo | 2 +- 11 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Modelica/Electrical/Batteries/BaseClasses/BaseCellStack.mo b/Modelica/Electrical/Batteries/BaseClasses/BaseCellStack.mo index 362044743b..f4ec9333ad 100644 --- a/Modelica/Electrical/Batteries/BaseClasses/BaseCellStack.mo +++ b/Modelica/Electrical/Batteries/BaseClasses/BaseCellStack.mo @@ -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 ( @@ -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, diff --git a/Modelica/Electrical/Batteries/BaseClasses/BaseCellWithSensors.mo b/Modelica/Electrical/Batteries/BaseClasses/BaseCellWithSensors.mo index b000df3ca0..4e9ca49833 100644 --- a/Modelica/Electrical/Batteries/BaseClasses/BaseCellWithSensors.mo +++ b/Modelica/Electrical/Batteries/BaseClasses/BaseCellWithSensors.mo @@ -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, diff --git a/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/IdealDcDc.mo b/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/IdealDcDc.mo index fa2ea507a5..dd58b222d0 100644 --- a/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/IdealDcDc.mo +++ b/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/IdealDcDc.mo @@ -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}}, diff --git a/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/LimitedPI.mo b/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/LimitedPI.mo index 2e409e4f6b..8f250cef31 100644 --- a/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/LimitedPI.mo +++ b/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/LimitedPI.mo @@ -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, diff --git a/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/PartialControlledDCPM.mo b/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/PartialControlledDCPM.mo index 49a451d149..5b067af6b1 100644 --- a/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/PartialControlledDCPM.mo +++ b/Modelica/Electrical/Machines/Examples/ControlledDCDrives/Utilities/PartialControlledDCPM.mo @@ -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, diff --git a/Modelica/Electrical/Machines/Examples/DCMachines/DCPM_CurrentControlled.mo b/Modelica/Electrical/Machines/Examples/DCMachines/DCPM_CurrentControlled.mo index 2baa817781..de4ffb450b 100644 --- a/Modelica/Electrical/Machines/Examples/DCMachines/DCPM_CurrentControlled.mo +++ b/Modelica/Electrical/Machines/Examples/DCMachines/DCPM_CurrentControlled.mo @@ -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) diff --git a/Modelica/Electrical/PowerConverters/ACAC/Control/VoltageToAngle.mo b/Modelica/Electrical/PowerConverters/ACAC/Control/VoltageToAngle.mo index d470d25b00..c7b33a2297 100644 --- a/Modelica/Electrical/PowerConverters/ACAC/Control/VoltageToAngle.mo +++ b/Modelica/Electrical/PowerConverters/ACAC/Control/VoltageToAngle.mo @@ -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}}))); diff --git a/Modelica/Magnetic/QuasiStatic/FundamentalWave/Examples/BasicMachines/SynchronousMachines/SMPM_FieldWeakening.mo b/Modelica/Magnetic/QuasiStatic/FundamentalWave/Examples/BasicMachines/SynchronousMachines/SMPM_FieldWeakening.mo index 6bc868d0d1..479ae22cf0 100644 --- a/Modelica/Magnetic/QuasiStatic/FundamentalWave/Examples/BasicMachines/SynchronousMachines/SMPM_FieldWeakening.mo +++ b/Modelica/Magnetic/QuasiStatic/FundamentalWave/Examples/BasicMachines/SynchronousMachines/SMPM_FieldWeakening.mo @@ -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, diff --git a/Modelica/Mechanics/Translational/Components/Vehicle.mo b/Modelica/Mechanics/Translational/Components/Vehicle.mo index 4aaebe883b..c84465b878 100644 --- a/Modelica/Mechanics/Translational/Components/Vehicle.mo +++ b/Modelica/Mechanics/Translational/Components/Vehicle.mo @@ -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 diff --git a/Modelica/Mechanics/Translational/Examples/Vehicle.mo b/Modelica/Mechanics/Translational/Examples/Vehicle.mo index c5d8ccef80..a01dbbfe7f 100644 --- a/Modelica/Mechanics/Translational/Examples/Vehicle.mo +++ b/Modelica/Mechanics/Translational/Examples/Vehicle.mo @@ -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}}, diff --git a/Modelica/Thermal/FluidHeatFlow/Examples/WaterPump.mo b/Modelica/Thermal/FluidHeatFlow/Examples/WaterPump.mo index 11fdfbf615..d858c2fb8f 100644 --- a/Modelica/Thermal/FluidHeatFlow/Examples/WaterPump.mo +++ b/Modelica/Thermal/FluidHeatFlow/Examples/WaterPump.mo @@ -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}})));