From 40210f6e2e1605b54b2a2153cf43fef4e5e2ff99 Mon Sep 17 00:00:00 2001
From: Francesco Casella
+The parameter homotopyType
in the Advanced tab specifies the
+simplified behaviour if homotopy-based initialization is used:
+
noHomotopy
: the actual expression with limits is usedlinear
: a linear behaviour y = u is assumed (default option)uMax
: it is assumed that the output is stuck at the upper limit u = uMaxuMin
: it is assumed that the output is stuck at the lower limit u = uMax+If it is known a priori in which region the input signal will be located, this option can help +a lot by removing one strong nonlinearity from the initialization problem. +
"), Icon(coordinateSystem( preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics={ @@ -100,6 +132,10 @@ as output. extends Interfaces.SISO; parameter Boolean strict=false "= true, if strict limits with noEvent(..)" annotation (Evaluate=true, choices(checkBox=true)); + parameter Types.VariableLimiterHomotopy homotopyType = Modelica.Blocks.Types.VariableLimiterHomotopy.linear "Simplified model for homotopy-based initialization" + annotation (Evaluate=true, Dialog(tab="Advanced")); + parameter Real ySimplified = 0 "Fixed value of output in simplified model" + annotation (Dialog(tab="Advanced")); parameter Boolean limitsAtInit=true "Has no longer an effect and is only kept for backwards compatibility (the implementation uses now the homotopy operator)" annotation (Dialog(tab="Dummy"),Evaluate=true, choices(checkBox=true)); @@ -109,13 +145,27 @@ as output. Interfaces.RealInput limit2 "Connector of Real input signal used as minimum of input u" annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); + protected + Real simplifiedExpr "Simplified expression for homotopy-based initialization"; equation assert(limit1 >= limit2, "Input signals are not consistent: limit1 < limit2"); - + simplifiedExpr = (if homotopyType == Types.VariableLimiterHomotopy.linear then u + else if homotopyType == Types.VariableLimiterHomotopy.fixed then ySimplified + else 0); if strict then - y = homotopy(actual = smooth(0, noEvent(if u > limit1 then limit1 else if u < limit2 then limit2 else u)), simplified=u); + if homotopyType == Types.VariableLimiterHomotopy.noHomotopy then + y = smooth(0, noEvent(if u > limit1 then limit1 else if u < limit2 then limit2 else u)); + else + y = homotopy(actual = smooth(0, noEvent(if u > limit1 then limit1 else if u < limit2 then limit2 else u)), + simplified=simplifiedExpr); + end if; else - y = homotopy(actual = smooth(0,if u > limit1 then limit1 else if u < limit2 then limit2 else u), simplified=u); + if homotopyType == Types.VariableLimiterHomotopy.noHomotopy then + y = smooth(0,if u > limit1 then limit1 else if u < limit2 then limit2 else u); + else + y = homotopy(actual = smooth(0,if u > limit1 then limit1 else if u < limit2 then limit2 else u), + simplified=simplifiedExpr); + end if; end if; annotation ( @@ -127,6 +177,19 @@ limits specified by the two additional inputs limit1 and limit2. If this is not the case, the corresponding limit is passed as output. +
+The parameter homotopyType
in the Advanced tab specifies the
+simplified behaviour if homotopy-based initialization is used:
+
noHomotopy
: the actual expression with limits is usedlinear
: a linear behaviour y = u is assumed (default option)fixed
: it is assumed that the output is fixed at the value ySimplified
+If it is known a priori in which region the input signal will be located, this option can help +a lot by removing one strong nonlinearity from the initialization problem. +