RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • damp
    • db
    • dcgain
    • feedback
    • impulse
    • isstable
    • lqr
    • nyquist
    • pole
    • pzmap
    • rlocus
    • ss
    • step
    • stepinfo
    • tf
    • zero

dcgain — Evaluate steady-state gain of SISO transfer-function models.

dcgain(sys) computes the low-frequency gain of an LTI model: the transfer-function value at s = 0 for continuous-time models or z = 1 for discrete-time models. RunMat currently implements the SISO tf subset.

Syntax

gain = dcgain(sys)

Inputs

NameTypeRequiredDefaultDescription
sysAnyYes—SISO tf model.

Returns

NameTypeDescription
gainAnySteady-state gain evaluated at s=0 for continuous-time or z=1 for discrete-time.

Errors

IdentifierWhenMessage
RunMat:dcgain:InvalidArgumentInput does not match supported invocation forms.dcgain: invalid argument
RunMat:dcgain:InvalidModelInput system is not a valid SISO tf object.dcgain: invalid model
RunMat:dcgain:UnsupportedModelModel form is not supported by the current implementation.dcgain: unsupported model
RunMat:dcgain:InternalGain evaluation failed internally.dcgain: internal error

How dcgain works

  • Current RunMat support is limited to SISO tf objects; MATLAB also supports broader LTI model families and MIMO gain matrices.
  • Returns a real scalar for real-valued gains and a complex scalar for complex-valued gains.
  • Continuous-time models are evaluated at zero frequency.
  • Discrete-time models are evaluated at z = 1.
  • A typed integer array is not a valid sys input. Integer coefficients admitted by tf have already crossed the model constructor's numeric boundary and do not make dcgain an integer-array operation.
  • The documented DC gain is infinite for systems with integrators. RunMat derives the sign or complex axis from the first nonzero local denominator coefficient at the DC evaluation point, avoiding spurious NaN components while preserving exact pole-zero cancellation as indeterminate.

GPU memory and residency

dcgain returns a host scalar for the currently supported SISO form. A resident numeric array is not a dynamic-system object and is rejected without gather or provider dispatch.

Examples

Continuous-time DC gain

H = tf(2, [1 3]);
dcgain(H)

Expected output:

ans = 0.6667

Infinite gain of an integrator

H = tf(2, [1 0]);
dcgain(H)

Expected output:

ans = Inf

How RunMat validates dcgain

dcgain validates the object boundary before provider access and evaluates SISO transfer-function numerator and denominator polynomials at the steady-state point. Tests cover finite gains, signed continuous integrator infinity, discrete integrator infinity, complex-axis singular direction, exact pole-zero cancellation, invalid integer sys inputs, and integer coefficients already admitted by tf; broader LTI families and MIMO gain matrices remain explicit general control-system gaps.

  • Implementation: `crates/runmat-runtime/src/builtins/control/dcgain.rs`

See Correctness & Trust for the full methodology and coverage table.

Using dcgain with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how dcgain changes the result.

Run a small dcgain example, explain the result, then change one input and compare the output.

FAQ

Does dcgain simulate a step response?⌄

No. It evaluates the transfer-function polynomials directly at the steady-state point.

Related Control functions

damp · db · feedback · impulse · isstable · lqr · nyquist · pole · pzmap · rlocus · ss · step · stepinfo · tf · zero

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how dcgain is executed, line by line, in Rust.

  • View the source for dcgain in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How dcgain works
  • GPU memory and residency
  • Examples
  • Continuous-time DC gain
  • Infinite gain of an integrator
  • How RunMat validates dcgain
  • Using dcgain with coding agents
  • FAQ
  • Related Control functions
  • Open-source implementation
  • About RunMat