Xcos vs. Simulink® – Discontinuous time library conversion

In the table below you can find the equivalent between the Simulink® and Xcos blocks for Discontinuous time library/palette. The block which are not present in both libraries are omitted from the table.

This conversion table can be used in case you need to convert a Simulink® model to an Xcos block diagram model or vice-versa.

Simulink Discontinuities time library Xcos Discontinuities time palette Xcos block description
Simulink® BacklashBacklash Xcos BacklashBacklash The block Backlash allows the representation of a system presenting a mechanical play like system of gearings. When the input increases (decreases), changes of the input of the block Backlash give equal changes of its output. When the input changes direction, the system is disengaged during a short moment (the play is called deadband or gap). Therefor, at the initial moment of the change, the input has no effect and the output remains constant. Then, changes of the input give equal changes on the output up to the next change of direction of the input.
Simulink® Dead ZoneDead zone Xcos DeadbandDeadband The Dead Band block provides a region of zero output.
It’s a range of inputs for which the output remains unchanged. Outside that range there is a linear relationship between the deadband input u(k) and the dead band output v(k).
Simulink® RelayRelay Xcos HysteresisHysteresis Switch output between two constants.The Relay block allows its output to switch between two specified values. When the relay is on, it remains on until the input drops below the value of the Switch off point parameter. When the relay is off, it remains off until the input exceeds the value of the Switch on point parameter. The block accepts one input and generates one output.
Simulink® Rate LimiterRate limiter Xcos Rate LimiterRate limiter The Rate Limiter block limits the first derivative of the signal passing through it. The output changes no faster than the specified limit.
Simulink® QuantizerQuantizer Xcos QuantizerQuantization This block outputs the quantization of the input according to a choice of methods (quantization types)
Simulink® SaturationSaturation Xcos SaturationSaturation The Saturation block imposes upper and lower bounds on a signal. When the input signal is within the range specified by the Lower limit and Upper limit parameters, the input signal passes through unchanged. When the input signal is outside these bounds, the signal is clipped to the upper or lower bound. When the Lower limit and Upper limit parameters are set to the same value, the block outputs that value.

Let’s look at a simple example in which we create a Simulink® block diagram model, simulate it and plot the results. We’ll recreate the equivalent model in Xcos and check if the results are the same.

Simulink® block diagram model

Simulink® model - Discontinuities Library blocks

Image: Simulink® model – Discontinuities Library blocks

The purpose of the model is only to use some of the Continuous time Simulink® blocks which have an equivalent in the Xcos palette.

The main parameters of each block are displayed under the name. The same parameters are going to be used for the Xcos block diagram.

By running the Simulink® model above, we get the following plot window:

Simulink® model plot - Discontinuities Library blocks

Image: Simulink® model plot – Discontinuities Library blocks

Xcos block diagram model

We follow the same approach for the Xcos block diagram model. Using equivalent blocks (see table above), we recreate the same functionality of the Simulink model.

Xcos model - Discontinuities palette blocks

Image: Xcos model – Discontinuities palette blocks

The block parameters have the same values as those in the Simulink block diagram.

After running the Xcos model for 10 s, we get the following graphical window:

Xcos model plot - Discontinuities palette blocks

Image: Xcos model plot – Discontinuities palette blocks

As you can see, the outputs of the Xcos block diagram model are identical with the Simulink results. This proves that we can use Xcos as an alternative to Simulink, when we want to simulate and analyze discontinuous time models.

For any questions, observations and queries regarding this article, use the comment form below.

Don’t forget to Like, Share and Subscribe!

Leave a Reply

Ad Blocker Detected

Dear user, Our website provides free and high quality content by displaying ads to our visitors. Please support us by disabling your Ad blocker for our site. Thank you!

Refresh