RunMat
GitHub

damp — Return natural frequencies, damping ratios, and poles for control models.

damp(sys) analyzes supported control models by deriving natural frequencies and damping ratios from their poles.

Syntax

wn = damp(sys)
[wn, zeta] = damp(sys)
[wn, zeta, p] = damp(sys)

Inputs

NameTypeRequiredDefaultDescription
sysAnyYesSISO tf model or ss state-space model.

Returns

NameTypeDescription
wnNumericArrayNatural frequencies as an N-by-1 column vector.
zetaNumericArrayDamping ratios as an N-by-1 column vector.
pAnyModel poles as an N-by-1 real or complex column vector.

Returned values from damp depend on how many outputs the caller requests.

Errors

IdentifierWhenMessage
RunMat:damp:InvalidModelInput system is malformed or missing model metadata.damp: invalid model
RunMat:damp:UnsupportedModelModel class is unsupported.damp: unsupported model
RunMat:damp:OutputCountMore than three outputs are requested.damp: too many output arguments
RunMat:damp:InternalPole extraction or output construction failed.damp: internal error

How damp works

  • Supports SISO tf objects and ss state-space objects.
  • Returns wn and zeta as N x 1 real column vectors.
  • Returns poles as an N x 1 real vector when all poles are real, or an N x 1 complex vector when any pole has a nonzero imaginary part.
  • For continuous-time models, wn = abs(p) and zeta = -real(p) / wn.
  • For discrete-time models, damping metrics use the equivalent continuous pole log(p) / Ts, while the p output preserves the original discrete pole.
  • Static-gain transfer functions return empty column vectors.

GPU memory and residency

damp returns host-resident vectors.

Example

Second-order transfer function

G = tf(1, [100 50 400]);
[wn, zeta, p] = damp(G)

Expected output:

wn contains values near 2, zeta contains values near 0.125, and p contains the complex pole pair.

How RunMat validates damp

damp validates model metadata, extracts poles from transfer-function denominators or state-space state matrices, and materializes MATLAB-style column outputs. Tests cover continuous and discrete transfer functions, state-space models, output counts, and descriptor metadata.

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

Using damp with coding agents

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

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

FAQ

Does damp cancel pole-zero pairs?

No. For tf objects it analyzes the stored denominator polynomial.

Does damp support discrete-time systems?

Yes. Natural frequency and damping ratio are computed from log(p) / Ts; the returned poles remain in the discrete domain.

db · dcgain · feedback · impulse · isstable · nyquist · pole · rlocus · ss · step · stepinfo · tf · zero

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how damp 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.