BlockWerk Documentation
H(s)

TransferFunction

Continuous

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.

Simulate in BlockWerk

Interactive sandbox directly in your browser — zero installation, WASM-powered.

Simulate in BlockWerk →

Mathematical Model

H(s)=num(s)den(s)H(s) = \frac{\text{num}(s)}{\text{den}(s)}

Where:

  • num(s) = numerator polynomial coefficients
  • den(s) = denominator polynomial coefficients
  • s = Laplace variable

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

Inputs & Outputs

Direction ID Label Type Status
→ In in Input number Required
→ In reset Reset number Optional
← Out out Output number Output

Parameters

Parameters Label Type Default Description
numerator Numerator polynomial 1
denominator Denominator polynomial s+1
initialCondition Initial Condition number 0

Usage 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

Remarks & Best Practices

  • State-Space Realization: Internally converted to controllable canonical form for numerically stable integration
  • Polynomial Syntax: Use s for Laplace variable, s^2 for powers. Supports negative coefficients (e.g., s^2 - 2s + 1)
  • Order Restriction: The numerator degree must be less than or equal to the denominator degree (proper transfer function)
  • Time-Step Sensitivity: Higher order systems require smaller simulation time steps for accuracy and stability

Related Components