RunMat
GitHub

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

dcgain(sys) evaluates a SISO transfer function at s = 0 for continuous-time models or z = 1 for discrete-time models.

Syntax

gain = dcgain(sys)

Inputs

NameTypeRequiredDefaultDescription
sysAnyYesSISO 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

  • Supports SISO tf objects.
  • 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.

GPU memory and residency

dcgain returns a host scalar.

Example

Continuous-time DC gain

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

Expected output:

ans = 0.6667

How RunMat validates dcgain

dcgain validates the input model and evaluates numerator and denominator polynomials at the steady-state point. Tests cover real continuous-time gains and VM integration.

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.

db · feedback · impulse · isstable · nyquist · pole · ss · step · stepinfo · tf

Open-source implementation

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

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.