Transfer Fcn First Order — Control Systems/Discrete
Control_Systems/Discrete/Transfer_Fcn_First_Order · 1 input / 1 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text
Description#
The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.
Transfer Fcn First Order
Control Systems / Discrete
A first-order lag whose pole is given directly in the z plane:
H(z) = (1 − P)·z / (z − P)
realized as the one-line recursion y[k] = P·y[k−1] + (1 − P)·u[k]. The numerator's (1 − P) is what makes H(1) = 1: whatever the pole, a constant input settles to itself, so P sets only how fast the block gets there and never how far. On the very first sample there is no previous output, so the configured initial condition stands in for it.
Ports
- Input – the signal u to filter, of any size [p,m].
- Output – the filtered signal y, the SAME size [p,m] as the input.
The transfer function is scalar, but it is applied independently to every entry of the input signal, each entry remembering its own previous output.
Parameters
- Pole (in Z Plane) – a scalar P, the single pole. Defaults to 0.95, Simulink's own default. |P| < 1 is a stable lag, and the closer to 1 the slower it settles; P = 0 makes the block a straight wire, and |P| > 1 diverges. It is not checked against the unit circle: an unstable pole is a legitimate thing to model.
- Initial Condition (Previous Output) – a scalar standing in for y[−1] on the first sample, broadcast to every entry of the signal. Defaults to 0. It decays away at the rate P rather than affecting one sample only, so on a slow pole it is visible for a long time.
- Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.
Code export
All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text, all from the shared realization every linear Control Systems / Discrete block uses. The pole and the initial condition are baked into the generated core at export time rather than exposed as tunable parameters: the pole is folded into the A/B/C/D coefficients, and the initial condition seeds a state rather than scaling arithmetic.
Simulink bridge
Import and export, mapped to
simulink/Discrete/Transfer Fcn First Order. "Pole (in Z Plane)" to
PoleZ, "Initial Condition (Previous Output)" to
ICPrevOutput. Both cross as plain numbers, so the mapping is
lossless in either direction.
"Sampling Time (s)" does not cross, unusually: Simulink's block is a
masked subsystem with no SampleTime parameter at all, so the
rate stays on the ICore side and a block configured with an explicit positive rate
reports that it did not carry over. In Simulink it simply inherits the rate of
whatever drives it.
Simulink's RndMeth and DoSatur are left at their
defaults and have no ICore counterpart: they select a rounding mode and an
overflow policy that only bite on fixed-point or integer signals, and ICore's
signal path is double precision throughout.
Notes
- Discrete only, and stateful: one past output per entry.
- Being linear, the block is directly usable by the model reduction and linear-analysis commands.
- First Order vs. Lead or Lag. This block is the special case of Transfer Fcn Lead or Lag with the zero at the origin and the gain normalized, so reach for that one whenever the numerator needs a zero of its own.
Code facts#
| Fact | Value |
|---|---|
| registered type | Control_Systems/Discrete/Transfer_Fcn_First_Order |
| family | Control_Systems/Discrete |
| solver environment class | ICoreBlock_0_Control_Systems_1_Discrete_2_Transfer_Fcn_First_Order |
| source | src/ICoreSDK/ICoreBlockLibrary/Blocks/Control_Systems/Discrete/Transfer_Fcn_First_Order/ICoreBlock_0_Control_Systems_1_Discrete_2_Transfer_Fcn_First_Order.cpp |
| header | src/ICoreSDK/ICoreBlockLibrary/Blocks/Control_Systems/Discrete/Transfer_Fcn_First_Order/ICoreBlock_0_Control_Systems_1_Discrete_2_Transfer_Fcn_First_Order.h |
| default size on canvas | 130 × 80 px |
| ports at insert | 1 in, 1 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
| # | Direction | Signal type | Description label |
|---|---|---|---|
| 1 | in | ICoreDouble | — |
| 2 | out | ICoreDouble | — |
Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Pole (in Z Plane) | 0.95 | PoleZ |
Initial Condition (Previous Output) | 0 | ICPrevOutput |
Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.
Simulink bridge#
| support | Support::Both |
| Simulink path | simulink/Discrete/Transfer Fcn First Order |
| port-count rule | PortsParam::None |
SampleTime parameter | no — the counterpart defines none; the rate stays on the ICore side |
| ICore config | Simulink parameter | Value translation |
|---|---|---|
Pole (in Z Plane) | PoleZ | passes through |
Initial Condition (Previous Output) | ICPrevOutput | passes through |
Caveat (shown to the user): the sampling time does not cross: Simulink's Transfer Fcn First Order is a masked subsystem with no SampleTime parameter, and inherits the rate of whatever drives it
Catalog contract: src/ICoreSDK/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h
Description vs code#
The lists agree. check_block_descriptions.py finds no disagreement between the description's Ports, Parameters, Code export and Simulink bridge lists and the code's.
The verdict above is
tools/docs/check_block_descriptions.py(P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.
File banner (developer view)#
The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).
Transfer Fcn First Order block — y[k] = P*y[k-1] + (1-P)*u[k], element-wise One state, and it IS the previous output, which is what makes Simulink's initial condition carry over without rescaling. See the header for the A/B/C/D. Everything below the matrices comes from ICoreDiscreteLinearBlockBase.
Sample results#
The same rig also ran:
| Stimulus | What it is | Output range |
|---|---|---|
impulse | Impulse: one sample of 1 at k = 5, 0 elsewhere (Repeating Sequence Stair) | 0 … 0.05 |
ramp | Ramp: slope 1 from t = 0 | 0 … 3.997 |
sine | Sine Wave: amplitude 1, 2 rad/s, no phase, no bias | -0.1981 … 0.3643 |
table | Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample | -0.1628 … 0.5203 |
Plotted: step — Step: 0 -> 1 at t = 1 s
Category dynamic · sample time 0.1 · 60 steps · commit ccf005c8 · produced by docsSample --out <folder> --steps 60 · data docs/generated/samples/Control_Systems__Discrete__Transfer_Fcn_First_Order.json · the SVG is generated from those numbers by tools/docs/plot_svg.py, so it is a run and not a drawing (R-D10).