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
| Type | Name | Default | Description |
|---|---|---|---|
| Sampling | |||
| Real | Ts | 0.001 | Sampling time |
| Real numbers | |||
| Real | eps | 0.01 | Comparison threshold |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| RealType.Equal | equal | ||
| Modelica.Blocks.Sources.Sine | sine | ||
| Modelica.Blocks.Sources.Sine | cosine | ||
| RealType.Less | less |
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".