Modelica.Blocks.Continuous.LimIntegrator Modelica.Blocks.Continuous.LimIntegrator

Integrator with limited value of the output

Modelica.Blocks.Continuous.LimIntegrator

Information

This blocks computes y (element-wise) as integral of the input u multiplied with the gain k. If the integral reaches a given upper or lower limit and the input will drive the integral outside of this bound, the integration is halted and only restarted if the input drives the integral away from the bounds.

It might be difficult to initialize the integrator in steady state. This is discussed in the description of package Continuous.

If parameter limitAtInit = false, the limits of the integrator are removed from the initialization problem which leads to a much simpler equation system. After initialization has been performed, it is checked via an assert whether the output is in the defined limits. For backward compatibility reasons limitAtInit = true. In most cases it is best to use limitAtInit = false.

Extends from Interfaces.SISO (Single Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
Realk1Integrator gain [1]
RealoutMax Upper limit of output
RealoutMin-outMaxLower limit of output
Initialization
InitinitTypeModelica.Blocks.Types.Init.I...Type of initialization (1: no init, 2: steady state, 3/4: initial output)
BooleanlimitsAtInittrue= false, if limits are ignored during initialization (i.e., der(y)=k*u)
Realy_start0Initial or guess value of output (must be in the limits outMin .. outMax)
RealOutputy.starty_startConnector of Real output signal
Advanced
Booleanstrictfalse= true, if strict limits with noEvent(..)

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal

Modelica definition

block LimIntegrator "Integrator with limited value of the output" import Modelica.Blocks.Types.Init; parameter Real k(unit="1") = 1 "Integrator gain"; parameter Real outMax(start=1) "Upper limit of output"; parameter Real outMin=-outMax "Lower limit of output"; parameter Modelica.Blocks.Types.Init initType=Modelica.Blocks.Types.Init.InitialState "Type of initialization (1: no init, 2: steady state, 3/4: initial output)"; parameter Boolean limitsAtInit=true "= false, if limits are ignored during initialization (i.e., der(y)=k*u)"; parameter Real y_start=0 "Initial or guess value of output (must be in the limits outMin .. outMax)"; parameter Boolean strict=false "= true, if strict limits with noEvent(..)"; extends Interfaces.SISO(y(start=y_start)); initial equation if initType == Init.SteadyState then der(y) = 0; elseif initType == Init.InitialState or initType == Init.InitialOutput then y = y_start; end if; equation if initial() and not limitsAtInit then der(y) = k*u; assert(y >= outMin - 0.001*abs(outMax - outMin) and y <= outMax + 0.001*abs (outMax - outMin), "LimIntegrator: During initialization the limits have been ignored.\n" + "However, the result is that the output y is not within the required limits:\n" + " y = " + String(y) + ", outMin = " + String(outMin) + ", outMax = " + String(outMax)); elseif strict then der(y) = noEvent(if y < outMin and k*u < 0 or y > outMax and k*u > 0 then 0 else k*u); else der(y) = if y < outMin and k*u < 0 or y > outMax and k*u > 0 then 0 else k* u; end if; end LimIntegrator;

Modelica.Blocks.Continuous.Integrator Modelica.Blocks.Continuous.Integrator

Output the integral of the input signal

Modelica.Blocks.Continuous.Integrator

Information

This blocks computes output y (element-wise) as integral of the input u multiplied with the gain k:

         k
     y = - u
         s

It might be difficult to initialize the integrator in steady state. This is discussed in the description of package Continuous.

Extends from Interfaces.SISO (Single Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
Realk1Integrator gain [1]
Initialization
InitinitTypeModelica.Blocks.Types.Init.I...Type of initialization (1: no init, 2: steady state, 3,4: initial output)
Realy_start0Initial or guess value of output (= state)
RealOutputy.starty_startConnector of Real output signal

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal

Modelica definition

block Integrator "Output the integral of the input signal" import Modelica.Blocks.Types.Init; parameter Real k(unit="1") = 1 "Integrator gain"; /* InitialState is the default, because it was the default in Modelica 2.2 and therefore this setting is backward compatible */ parameter Modelica.Blocks.Types.Init initType=Modelica.Blocks.Types.Init.InitialState "Type of initialization (1: no init, 2: steady state, 3,4: initial output)"; parameter Real y_start=0 "Initial or guess value of output (= state)"; extends Interfaces.SISO(y(start=y_start)); initial equation if initType == Init.SteadyState then der(y) = 0; elseif initType == Init.InitialState or initType == Init.InitialOutput then y = y_start; end if; equation der(y) = k*u; end Integrator;

Modelica.Blocks.Continuous.FirstOrder Modelica.Blocks.Continuous.FirstOrder

First order transfer function block (= 1 pole)

Modelica.Blocks.Continuous.FirstOrder

Information

This blocks defines the transfer function between the input u and the output y (element-wise) as first order system:

               k
     y = ------------ * u
            T * s + 1

If you would like to be able to change easily between different transfer functions (FirstOrder, SecondOrder, ... ) by changing parameters, use the general block TransferFunction instead and model a first order SISO system with parameters
b = {k}, a = {T, 1}.

Example:
   parameter: k = 0.3, T = 0.4
   results in:
             0.3
      y = ----------- * u
          0.4 s + 1.0

Extends from Interfaces.SISO (Single Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
Realk1Gain [1]
TimeT Time Constant [s]
Initialization
InitinitTypeModelica.Blocks.Types.Init.N...Type of initialization (1: no init, 2: steady state, 3/4: initial output)
Realy_start0Initial or guess value of output (= state)
RealOutputy.starty_startConnector of Real output signal

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal

Modelica definition

block FirstOrder "First order transfer function block (= 1 pole)" import Modelica.Blocks.Types.Init; parameter Real k(unit="1") = 1 "Gain"; parameter SIunits.Time T(start=1) "Time Constant"; parameter Modelica.Blocks.Types.Init initType=Modelica.Blocks.Types.Init.NoInit "Type of initialization (1: no init, 2: steady state, 3/4: initial output)"; parameter Real y_start=0 "Initial or guess value of output (= state)"; extends Interfaces.SISO(y(start=y_start)); initial equation if initType == Init.SteadyState then der(y) = 0; elseif initType == Init.InitialState or initType == Init.InitialOutput then y = y_start; end if; equation der(y) = (k*u - y)/T; end FirstOrder;

Modelica.Blocks.Continuous.PI Modelica.Blocks.Continuous.PI

Proportional-Integral controller

Modelica.Blocks.Continuous.PI

Information

This blocks defines the transfer function between the input u and the output y (element-wise) as PI system:

                 1
   y = k * (1 + ---) * u
                T*s
           T*s + 1
     = k * ------- * u
             T*s

If you would like to be able to change easily between different transfer functions (FirstOrder, SecondOrder, ... ) by changing parameters, use the general model class TransferFunction instead and model a PI SISO system with parameters
b = {k*T, k}, a = {T, 0}.

Example:

   parameter: k = 0.3,  T = 0.4

   results in:
               0.4 s + 1
      y = 0.3 ----------- * u
                 0.4 s

It might be difficult to initialize the PI component in steady state due to the integrator part. This is discussed in the description of package Continuous.

Extends from Interfaces.SISO (Single Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
Realk1Gain [1]
TimeT Time Constant (T>0 required) [s]
Initialization
InitinitTypeModelica.Blocks.Types.Init.N...Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)
Realx_start0Initial or guess value of state
Realy_start0Initial value of output

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal
output RealOutputyConnector of Real output signal

Modelica definition

block PI "Proportional-Integral controller" import Modelica.Blocks.Types.Init; parameter Real k(unit="1") = 1 "Gain"; parameter SIunits.Time T(start=1,min=Modelica.Constants.small) "Time Constant (T>0 required)"; parameter Modelica.Blocks.Types.Init initType=Modelica.Blocks.Types.Init.NoInit "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)"; parameter Real x_start=0 "Initial or guess value of state"; parameter Real y_start=0 "Initial value of output"; extends Interfaces.SISO; output Real x(start=x_start) "State of block"; initial equation if initType == Init.SteadyState then der(x) = 0; elseif initType == Init.InitialState then x = x_start; elseif initType == Init.InitialOutput then y = y_start; end if; equation der(x) = u/T; y = k*(x + u); end PI;

Automatically generated Sun Apr 02 18:12:02 2017.