is_ss_observable

Function is_ss_observable 

Source
pub fn is_ss_observable<T: StateSpaceModel>(model: &T) -> (bool, DMatrix<f64>)
Expand description

Checks if a given state-space model is observable.

§Arguments

  • model - A reference to a state-space model that implements the StateSpaceModel trait.

§Returns

  • A tuple with a bool which is true if the system is controllable, false otherwise and the observability matrix.

§Panics

This function will panic if the computation of the controllability matrix fails.

§Examples

use control_sys::analysis;
use control_sys::model;

let ss_model = model::DiscreteStateSpaceModel::from_matrices(
&nalgebra::dmatrix![1.0, -2.0;
                    2.0, 1.0],
&nalgebra::dmatrix![],
&nalgebra::dmatrix![1.0, 2.0],
&nalgebra::dmatrix![],
0.05,
);
let (is_observable, observability_matrix) = analysis::is_ss_observable(&ss_model);