1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! Reusable realization-building utilities shared by identification methods.
//!
//! This layer sits between:
//!
//! - known or estimated discrete-time Markov parameters
//! - higher-level realization algorithms such as ERA and OKID
//!
//! The implementation keeps the core deliberately small:
//!
//! - [`MarkovSequence`] stores the block sequence `H_0, H_1, ...`
//! - [`BlockHankel`] assembles dense block-Hankel matrices from that sequence
//! - [`ShiftedBlockHankelPair`] builds the standard ERA pair `(H0, H1)`
//!
//! The module is discrete-time focused. Continuous-time impulse responses are
//! functions of time rather than finite recurrence blocks, so a continuous
//! Markov abstraction would need an explicit sampling policy that belongs in a
//! later layer.
//!
//! In this context, a "realization" means a specific state-space model
//! `(A, B, C, D)` whose external input-output behavior matches some other
//! system description such as:
//!
//! - Markov parameters
//! - an impulse response
//! - a transfer function
//! - measured input/output data
//!
//! Realizations are not unique. If `(A, B, C, D)` is one realization and `T`
//! is any invertible state-coordinate change, then
//!
//! - `A' = T A T^-1`
//! - `B' = T B`
//! - `C' = C T^-1`
//! - `D' = D`
//!
//! is a different realization of the same external system. Identification and
//! realization algorithms therefore recover a state-space representation only
//! up to such internal coordinate changes. The role of the utilities in this
//! module is to build the structured data objects, such as Markov sequences
//! and shifted block-Hankel matrices, from which those equivalent
//! state-space models can later be constructed.
//!
//! Literature:
//!
//! - Juang and Pappa, "An Eigensystem Realization Algorithm for Modal
//! Parameter Identification and Model Reduction," Journal of Guidance,
//! Control, and Dynamics, 1985.
//! - Juang, Phan, Horta, and Longman, "Identification of Observer/Kalman
//! Filter Markov Parameters: Theory and Experiments," Journal of Guidance,
//! Control, and Dynamics, 1993.
//! - Van Overschee and De Moor, *Subspace Identification for Linear Systems*,
//! Kluwer, 1996.
//! - Brunton and Kutz, *Data-Driven Science and Engineering*, 2nd ed.,
//! Cambridge University Press, 2022, especially the realization and
//! identification material in Section 9.3.
//!
//! # Two Intuitions
//!
//! 1. **Data-structure view.** This module packages the discrete response data
//! that realization algorithms manipulate before they ever produce a state
//! matrix.
//! 2. **Shared-currency view.** It is also the common layer between
//! simulation-derived Markov parameters, OKID output, and ERA input.
//!
//! # Glossary
//!
//! - **Markov parameter:** Discrete impulse-response block.
//! - **Block-Hankel matrix:** Dense matrix formed by arranging Markov blocks on
//! anti-diagonals.
//! - **Shifted Hankel pair:** Two Hankel matrices offset by one Markov index.
//!
//! # Mathematical Formulation
//!
//! For a discrete-time state-space system, the Markov sequence is
//! `H_0 = D`, `H_k = C A^(k-1) B`, and Hankel matrices are built by arranging
//! those blocks into a structured dense matrix that exposes shift invariance.
//!
//! # Implementation Notes
//!
//! - The module is intentionally representation-focused; it does not attempt to
//! realize a state-space model by itself.
//! - Dense block assembly is used because that is the right practical trade for
//! the current ERA/OKID workflow.
pub use RealizationError;
pub use ;
pub use MarkovSequence;