Discrete

Trait Discrete 

Source
pub trait Discrete {
    // Required method
    fn sampling_dt(&self) -> f64;
}
Expand description

A trait representing a discrete system with a specific sampling time.

This trait should be implemented by any type that represents a discrete system and provides a method to retrieve the sampling time interval (dt).

§Examples

use control_sys::model::Discrete;

struct MyDiscreteSystem {
    sampling_dt: f64,
}

impl Discrete for MyDiscreteSystem {
    fn sampling_dt(&self) -> f64 {
        self.sampling_dt
    }
}

let system = MyDiscreteSystem { sampling_dt: 0.1 };
assert_eq!(system.sampling_dt(), 0.1);

Required Methods§

Source

fn sampling_dt(&self) -> f64

Returns the sampling time interval (dt) of the discrete system.

Implementors§