Continuous

TransferFunction Block

Linear transfer function in s-domain (Numerator/Denominator)

Open TransferFunction in BlockWerk →

# Transfer Function Block

Description

The Transfer Function block implements linear time-invariant (LTI) systems described in the Laplace domain. It takes a transfer function H(s) = num(s)/den(s) and simulates the system's response to input signals using numerical integration methods.

The block accepts numerator and denominator polynomials as text strings (e.g., "1" and "s+1" for a first-order lag) and internally converts them to a state-space representation for efficient computation.

Mathematical Model

H(s) = num(s) / den(s)

Where:

The block uses state-space realization (controllable canonical form) for numerical simulation.

Parameters

numerator

Polynomial coefficients for the numerator. Examples: 1, s + 1, s^2 + 2s + 1.

denominator

Polynomial coefficients for the denominator. Examples: s + 1, s^2 + 10s + 100.

initialCondition

Initial system state (output value at t=0).

Examples

Low-pass Filter

First-order system with 1 sec time constant:

Step (finalValue: 1) → TransferFunction (num: "1", den: "s+1") → Scope

Damped Oscillator

Second-order system with damping:

Impulse → TransferFunction (num: "100", den: "s^2+10s+100") → Scope

Stability Conditions (Forward Euler)

The Rust implementation uses Forward Euler integration. This method has a limited stability region: only the left half of the complex plane within a circle of radius 1/Δt centered at (-1/Δt, 0).

Practical implications:

Rule of thumb: Use Δt ≤ 1/(5 × fastest_pole_magnitude) for both stability and accuracy.

If the simulation becomes unstable (output grows without bound), reduce the sample time.

TypeScript Limitation

The TypeScript fallback executor only supports first-order systems (denominator order = 1). For higher-order systems, it throws an error directing the user to the Rust/WASM engine. The Rust implementation handles all orders correctly.

Remarks

See Also