blockStepFunctionSimpleXY

Simple constant-segment interpolation defined from 2 vectors
Diagram of StepFunctionSimpleXY

Information

Periodic constant-segment interpolation.

Hypothesis and equations

Constant-segment interpolation in one dimension specified by 2 vectors.

It could be periodic or not.

The dependent variable (homogenous to the input) is specified in the parameter X vector.

The independent variable to be interpolated are defined in the parameter Yvector.

Instructions for use

X vector (dependent variable) and Y vector (data to be interpolated) are 2 vectors having the same size: n elements each.

For all i from 1 to n-1, for any x in [Xi, X (i + 1) [, calculation of y = Yi

For all x >= Xn : y = Yn

For all x, calculation of xp = >if period > 0 then mod(x,period) else x and calculation of y=y(xp)

Validations

Validated model - Hassan Bouia 07/2012

--------------------------------------------------------------
Licensed by EDF under a 3-clause BSD-license
Copyright © EDF 2009 - 2023
BuildSysPro version 3.6.0
Author : Hassan BOUIA, EDF (2012)
--------------------------------------------------------------

Parameters

TypeNameDefaultDescription
Realperiode24Period in vector X units. If <=0 then periodicity is not considered
Real[:]XX Vector
Real[size(X, 1)]YY Vector

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputxDependent variable
Modelica.Blocks.Interfaces.RealOutputysum(Y[1:n - 1].*u) + (if xp >= X[n] then 1 else 0)*Y[n]Interpolated variable