runmat-runtime 0.4.9

Core runtime for RunMat with builtins, BLAS/LAPACK integration, and execution APIs
Documentation
{
  "title": "impulse",
  "category": "control",
  "keywords": [
    "impulse",
    "impulse response",
    "control system",
    "transfer function",
    "tf"
  ],
  "summary": "Compute or plot the impulse response of supported dynamic system models.",
  "references": [
    "title: \"MATLAB impulse documentation\"",
    "title: \"Octave control package impulse documentation\""
  ],
  "gpu_support": {
    "elementwise": false,
    "reduction": false,
    "precisions": [],
    "broadcasting": "none",
    "notes": "`impulse` evaluates host-side control-system metadata and returns host-resident response vectors."
  },
  "fusion": {
    "elementwise": false,
    "reduction": false,
    "max_inputs": 0,
    "constants": "inline",
    "notes": "`impulse` simulates a dynamic system response and terminates fusion chains."
  },
  "requires_feature": null,
  "tested": {
    "unit": "builtins::control::impulse::tests",
    "integration": "crates/runmat-vm/tests/control.rs"
  },
  "description": "`impulse(sys)` computes the impulse response for real, strictly proper, scalar-input scalar-output `tf` objects. With output arguments it returns numeric response data; when called in a no-output context and plotting is available, it plots the response.",
  "behaviors": [
    "Supports real SISO `tf` objects created by `tf(num, den)` or `tf(num, den, Ts)`.",
    "`impulse(sys)` uses a deterministic default time vector.",
    "`impulse(sys, tFinal)` generates a deterministic time vector from zero to `tFinal`.",
    "`impulse(sys, t)` respects an explicit real, finite, non-negative, strictly increasing time vector.",
    "`[y, t] = impulse(...)` returns `y` and `t` as `N x 1` column vectors for supported SISO systems.",
    "Continuous-time responses are evaluated from a controllable canonical state-space realization.",
    "Discrete-time responses respect MATLAB's unit-area impulse convention: the input pulse has height `1/Ts`, and time vectors must use integer multiples of `Ts`.",
    "Unsupported model classes, delays, complex coefficients, static gains, and non-strictly-proper transfer functions raise clear diagnostics."
  ],
  "examples": [
    {
      "description": "Compute a first-order impulse response",
      "input": "H = tf(20, [1 5]);\nt = 0:0.1:1;\n[y, tout] = impulse(H, t);",
      "output": "y and tout are column vectors."
    },
    {
      "description": "Plot an impulse response",
      "input": "H = tf(1, [1 3 2]);\nimpulse(H);"
    },
    {
      "description": "Discrete-time impulse response",
      "input": "H = tf(1, [1 -0.5], 0.1);\n[y, t] = impulse(H, 0:0.1:0.5);"
    }
  ],
  "faqs": [
    {
      "question": "Does `impulse` support MIMO systems?",
      "answer": "Not yet. The current implementation supports real SISO `tf` objects. Broader model-family and MIMO support is tracked separately."
    },
    {
      "question": "Why are non-strictly-proper transfer functions rejected?",
      "answer": "Those systems include a direct impulse term that is not represented as a finite numeric response vector in the current runtime model."
    },
    {
      "question": "Can I use state-space or zero-pole-gain models?",
      "answer": "Not yet. `ss`, `zpk`, `frd`, model arrays, and identified-system families are outside this first implementation."
    }
  ],
  "links": [
    {
      "label": "tf",
      "url": "./tf"
    },
    {
      "label": "plot",
      "url": "./plot"
    },
    {
      "label": "stem",
      "url": "./stem"
    }
  ],
  "source": {
    "label": "`crates/runmat-runtime/src/builtins/control/impulse.rs`",
    "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/control/impulse.rs"
  },
  "syntax": {
    "example": {
      "description": "Supported forms",
      "input": "impulse(sys)\ny = impulse(sys)\n[y, t] = impulse(sys)\n[y, t] = impulse(sys, tFinal)\n[y, t] = impulse(sys, t)",
      "output": "Response data is returned when outputs are requested; otherwise a plot is produced when plotting support is available."
    },
    "points": [
      "`sys` must currently be a real, strictly proper SISO `tf` object.",
      "`tFinal` must be a finite non-negative scalar.",
      "`t` must be a real vector of finite non-negative strictly increasing times. For discrete systems, values must be integer multiples of `sys.Ts`."
    ]
  },
  "validation": {
    "summary": "`impulse` validates the model class, coefficient type and shape, delay properties, strict properness, sample time, and time vector before simulation. Tests cover SISO continuous response values, discrete response values, explicit time input, multi-output shapes, and representative diagnostics.",
    "implementation": {
      "label": "`crates/runmat-runtime/src/builtins/control/impulse.rs`",
      "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/control/impulse.rs"
    }
  },
  "gpu_residency": "`impulse` returns host-resident response vectors. It does not preserve gpuArray residency."
}