CrySpace::StateSpace
Constructors
Class methods
Solves Sylvester equation: AX + XB = C. Returns X.
Instance methods
Computes a balanced realization of the system. Returns: {balanced_system, t_matrix, t_inv}
Computes the system bandwidth (the frequency at which magnitude drops by 3dB from DC gain).
Generates an interactive HTML dashboard containing a Bode Plot (Magnitude & Phase) using Chart.js.
Solves the Continuous Algebraic Riccati Equation: A^T * P + P * A - P * B * R^-1 * B^T * P + Q = 0 Returns P.
Computes the Complementary Sensitivity function T = GK * (I + GK)^-1
Simulates discrete current observer state-update step.
Solves the Discrete-Time Algebraic Riccati Equation (DARE) using Schur method: A^T * P * A - P - A^T * P * B * (R + B^T * P * B)^-1 * B^T * P * A + Q = 0 Returns P.
Solves discrete-time Linear Quadratic Regulator (DLQR) controller: u = -Kx Optionally handles cross-coupling matrix N_cross Returns: {K (matrix), P (matrix), closed_loop_poles (Array(Complex))}
Evaluates system response G(jw) at a set of frequency points. Returns a Tensor of Complex numbers of shape [n_outputs, n_inputs, omega.size].
Performs Frequency-Weighted Balanced Truncation model order reduction.
Computes the H2 norm of a continuous-time LTI system. Raises an error if D is non-zero (infinite H2 norm) or if system is discrete.
Synthesizes an optimal H2 state-feedback control gain K.
Performs Hankel Norm Approximation model order reduction.
Computes the exact peak gain (H-infinity norm) of a continuous-time system.
Synthesizes a robust suboptimal H-infinity state-feedback control gain K for attenuation level gamma.
Simulates impulse response of discrete or continuous (sampled) system.
Simulates unforced free response with non-zero initial state x0.
Computes the multi-loop/disk margin (or classical loop margins using Nyquist analysis).
Solves continuous-time Linear Quadratic Regulator (LQR) controller: u = -Kx Optionally handles cross-coupling matrix N_cross: minimizes integral of (x^TQx + u^TRu + 2x^TN_cross*u) Returns: {K (matrix), P (matrix), closed_loop_poles (Array(Complex))}
Solves finite-horizon Linear Quadratic Tracking (LQT) problems, returning backward recursion gains.
Simulates time response with arbitrary input (wrapper for simulate).
Performs linear simulation with input interpolation (wrapper for lsim).
Solves continuous-time Lyapunov equation: AP + PA^T + Q = 0 Returns P.
Extracts crossover frequencies. Returns: {omega_gc (gain crossover), omega_pc (phase crossover)}
Computes prefilter tracking scaling gain N for zero steady-state tracking error under LQR control u = -Kx + Nr
Performs H-infinity loop-shaping controller design.
Generates phase portrait trajectories for 2nd order systems.
Computes robust state-feedback gain matrix K to place closed-loop poles of a SISO or MIMO system.
Simulates ramp response of discrete or continuous (sampled) system.
Performs Singular Perturbation Model Reduction (Residualization), preserving the DC gain exactly.
Computes the Relative Gain Array (RGA) matrix at frequency omega.
Computes singular values of the frequency response matrix G(jw) over a range of frequency points. Returns: {omega, singular_values_matrix [omega.size, min(outputs, inputs)]}
Vectorized simulation: optimized for StateSpace systems
Simulates coupled state-feedback controller with an observer/estimator. Optionally adds process and measurement Gaussian noises under covariance matrices.
Builds a Smith Predictor structure compensating for time delays.
Generates an interactive HTML dashboard containing a Step Response plot using Chart.js.
Analyzes the step response of a SISO system and returns step response performance metrics.