First Order Hold

Implement linearly extrapolated first order hold on input signal

  • Library:
  • Simulink / Continuous

  • First Order Hold block

Description

The First Order Hold block outputs a continuous piecewise linear approximation of its input signal. Use the First Order Hold block to convert a sampled discrete signal to a continuous signal without triggering a solver reset.

You can also use the First Order Hold block to break algebraic loops in your model.

Ports

Input

expand all

Input signal, specified as a real-valued scalar, vector, or matrix.

Data Types: double

Output

expand all

Piecewise linear approximation of the input signal.

Data Types: double

Parameters

expand all

Specify the output that the block generates until the simulation time exceeds the first sample hit time of the discrete input.

Dependencies

  • The initial output of this block cannot be inf or NaN.

  • A Run-to-run tunable parameter cannot be changed during simulation run time. However, changing it before a simulation begins does not cause Accelerator or Rapid Accelerator to regenerate code.

Programmatic Use

Block Parameter: InitialOutput
Type: character vector, string
Values: scalar | vector
Default: '0'

Specify the approximation technique to use to smooth the input signal. The slow, or low pass algorithm aims to avoid overshoots when smoothing the input signal. The fast, or high pass algorithm minimizes error by attempting to predict the next input during the update method of the block. This error reduction in predicted output of the block is traded off against a tendency to overshoot the reference, or input signal.

Programmatic Use

Block Parameter: OutputAlgorithm
Type: character vector, string
Values: Slow (Avoid Overshoot)| Fast (Minimize Error)
Default: 'Slow (Avoid Overshoot)'

Specify the tolerance level for the extrapolation error of the Output Algorithm. Extrapolation error greater than this value will cause Simulink® to reset the solver for the model.

Tip

Enabling the Allow continuous input parameter when this parameter is set to inf can lead to numerical inaccuracies in simulation.

Programmatic Use

Block Parameter: ErrorTolerance
Type: character vector, string
Values: scalar
Default: 'inf'

Select this parameter to enable the block to accept continuous signals as input. Enabling this parameter creates a delay between the input and output continuous signals.

Note

Enable this parameter when using this block to break an algebraic loop.

Programmatic Use

Block Parameter: AllowContinuousInput
Type: character vector, string
Values: 'off'| 'on'
Default: 'off'

Block Characteristics

Data Types

double

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Algorithms

expand all

Extended Capabilities

Introduced in R2019b