Transfer Function
ContinuousThe TransferFunction block implements arbitrary linear time-invariant (LTI) continuous dynamic systems defined by numerator and denominator polynomials in the Laplace variable . It is one of the most fundamental blocks in control engineering, representing physical plants, analog and digital filter networks, sensor dynamics, and compensators. The block parses polynomial strings in standard symbolic notation (e.g. "s + 1" or "s^2 + 2s + 10"), constructs an internal controllable canonical state-space realization, and integrates system states using high-order WASM ODE solvers.
Video tutorial
Mathematical Model
In the Laplace domain (), the continuous transfer function relating input to output is:
where is defined by numerator and is defined by denominator.
For physical causality, the system must be proper ( with ). If , the system is strictly proper with direct feedthrough . If , the system has direct feedthrough .
Dividing numerator and denominator by normalizes the denominator to monic form (). The block realizes the system in controllable canonical state-space form:
The output equation is:
System stability is guaranteed if and only if all roots of the characteristic polynomial reside strictly in the open left half of the complex plane ().
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
Example 1: Third-Order Butterworth Low-Pass Butterworth Filter
Designing a continuous anti-aliasing low-pass filter with cutoff frequency . The normalized 3rd-order Butterworth polynomial is . Configuring numerator = "1000" and denominator = "s^3 + 20s^2 + 200s + 1000" attenuates high-frequency noise at while maintaining flat passband gain.
Example 2: Flexible Drive Shaft Resonant Dynamics
Modeling the torsional compliance of an industrial robotic joint with a natural resonance frequency of and damping ratio . Configuring numerator = "2500" and denominator = "s^2 + 5s + 2500" accurately reproduces high-frequency oscillatory torque transients in response to motor acceleration steps.
Remarks & Best Practices
- Proper System Requirement: The degree of the numerator must not exceed the degree of the denominator (). Non-causal improper systems () violate physical causality and trigger a configuration error.
- Continuous State Integration: Implemented as continuous ODE states in Rust/WASM, integrating smoothly with RK4, RK45 (Dormand-Prince), and stiff TR-BDF2 implicit solvers.
- Symbolic String Parsing Flexibility: The parser natively understands algebraic terms with exponents (e.g.
s^2 + 2s + 1), implicit multiplication (2s), explicit multiplication (2*s), and whitespace tolerance. - External Reset Support: Connecting a non-zero signal to the optional
resetinput port immediately zeroes all internal state integrator accumulators, enabling bumpless reset during operating mode transitions.
Frequently Asked Questions (FAQ)
Q: How to simulate high-order transfer functions without numerical instability?
Polynomial transfer functions with degree suffer from ill-conditioning in floating-point calculations because polynomial roots are hypersensitive to coefficient perturbations (Wilkinson's phenomenon). Decompose high-order polynomials into a cascade of first-order and second-order sections (biquads), or convert the system into State-Space modal canonical form.
Related Components
- ZeroPole: Factored pole-zero representation .
- SecondOrderSystem: Dedicated second-order model parameterized by and .
- LeadLag: First-order phase lead or phase lag compensator.
- Integrator: Pure continuous dynamic integration block.