Absolute value of input

control block
discrete
abs
absolute value
Author

Mathilde Bongrain

Published

April 10, 2024

Diagram

\[ x_j = |x_i | \]

absDiagram

Absolute value of input diagram

Syntax:

  • function name: abs
  • input variable : \(x_i\)
  • output variable: \(x_j\)

Internal states : none

Discrete variable : \(z \in \{-1,1\}\)

Equations

\[ 0 = \left\{ \begin{array}{lll} x_j - x_i & if & z=1 \\ x_i - x_j & if & z=-1 \end{array} \right. \]

Discrete transitions

if z = 1 then
    if xi < 0 then
        z ← −1
    end if
else
    if xi > 0 then
        z ← 1
    end if
end if

Initialization of discrete variables

if xi > 0 then
z ← 1
else
z ← 0
end if
Back to top

Found an issue with this page or want to suggest improvements?

📝 Evaluate