modelTestComparison

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

Description

In this examples are tested the Real comparison operations.
The two signals compared are:

u1(t) = sin(t)
u2(t) = cos(t)

The boolean signals are true if
u1(t) == u2(t)
u2(t) < u2(t)

Depending on the value of the sampling time Ts adopted and the tolerance value of eps, the conditions can be true or not.
In this case Ts = 0.001 and eps = 0.01



In this case Ts = 0.001 and eps = 0.001



It is evident that with a smaller tolerance, the boolean signal that represents the equality of the two signals becames shorter.

Parameters

TypeNameDefaultDescription
Sampling
RealTs0.001Sampling time
Real numbers
Realeps0.01Comparison threshold

Components

TypeNameDefaultDescription
RealType.Equalequal
Modelica.Blocks.Sources.Sinesine
Modelica.Blocks.Sources.Sinecosine
RealType.Lessless

Revisions

First release of the Industrial Control Systems: April-May 2012
List of revisions:

  • 11 May 2012 (author: Marco Bonvini)

Main Authors:
Marco Bonvini; <bonvini@elet.polimi.it>
Alberto Leva <leva@elet.polimi.it>
Politecnico di Milano
Dipartimento di Elettronica e Informazione
Via Ponzio 34/5
20133 Milano - ITALIA -
Copyright:
Copyright © 2010-2012, Marco Bonvini and Alberto Leva.
The IndustrialControlSystems package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions and the accompanying disclaimer in the documentation of package Modelica in file "Modelica/package.mo".