Skip to content

ltv_disc_frozen

MATLAB equivalent: sidLTVdiscFrozen

ltv_disc_frozen

Frozen transfer function from LTV state-space model.

ltv_disc_frozen

ltv_disc_frozen(ltv_result: LTVResult, *, frequencies: ndarray | None = None, time_steps: ndarray | None = None, sample_time: float = 1.0) -> FrozenResult

Compute the frozen (instantaneous) transfer function from an LTV model.

For each time step k and frequency w, evaluates the frozen transfer function

.. math::

G(w, k) = (e^{jw} I - A(k))^{-1} B(k)

If the ltv_result includes Bayesian uncertainty (from :func:sid.ltv_disc with uncertainty=True), the standard deviation of G is propagated via first-order (Jacobian) linearization using the rank-1 factorization described in SPEC.md S8.11.1.

Parameters:

Name Type Description Default
ltv_result LTVResult

Result struct from :func:sid.ltv_disc.

required
frequencies ndarray of shape (nf,) or None

Frequency vector in rad/sample. Default is 128 linearly spaced points in (0, pi].

None
time_steps ndarray of shape (nk,) or None

0-based indices of time steps to evaluate. Default is all time steps np.arange(N).

None
sample_time float

Sample time in seconds, used only for the frequency_hz output. Default is 1.0.

1.0

Returns:

Type Description
FrozenResult

Frozen dataclass with fields:

  • frequency (ndarray, shape (nf,)) -- Frequency in rad/sample.
  • frequency_hz (ndarray, shape (nf,)) -- Frequency in Hz.
  • time_steps (ndarray, shape (nk,)) -- Selected 0-based indices.
  • response (ndarray, shape (nf, py, q, nk)) -- Complex frozen transfer function (py = observation dim; equals the state dim n only when H = I).
  • response_std (ndarray or None, shape (nf, py, q, nk)) -- Standard deviation of response. None when the input LTVResult has no uncertainty.
  • sample_time (float) -- Sample time.
  • method (str) -- 'ltv_disc_frozen'.

Raises:

Type Description
SidError

If any element of time_steps is outside [0, N-1] (code: 'bad_time_steps').

Examples:

Basic usage with default frequencies and all time steps:

>>> import sid
>>> ltv = sid.ltv_disc(X, U, lambda_=1e5, uncertainty=True)
>>> frz = sid.ltv_disc_frozen(ltv)

Custom frequencies and selected time steps:

>>> import numpy as np
>>> w = np.logspace(-2, np.log10(np.pi), 200)
>>> frz = sid.ltv_disc_frozen(ltv, frequencies=w, time_steps=np.array([0, 49, 99]))
Notes

Algorithm:

  1. Build a frequency grid (default 128 points in (0, pi]).
  2. For each selected time step k and frequency w, compute the resolvent R = (z I - A(k))^{-1} via numpy.linalg.solve and the frozen response G(k) = R B(k).
  3. If the LTVResult carries uncertainty, propagate it using the rank-1 Jacobian factorization:

.. math::

   \operatorname{Var}(G_{ab}) =
       (v^H P(k) v) \cdot (r_a \Sigma r_a^H)

where v = [G_k(:,b); e_b], r_a = R(a,:), P(k) is the row-wise posterior covariance, and Sigma is the noise covariance.

Specification: SPEC.md S8.9

References

.. [1] Carvalho, Soares, Lourenco, Ventura. "COSMIC: fast closed-form identification from large-scale data for LTV systems." arXiv:2112.04355, 2022.

See Also

sid.ltv_disc : LTV state-space identification. sid.freq_map : Time-varying frequency response via short-time windows.

Changelog

2026-04-08 : First version (Python port) by Pedro Lourenco.