pub struct LtiDynamics<T: LinalgScalar> {
    pub a_mat: Array2<T>,
    pub b_mat: Array2<T>,
    pub c_mat: Array2<T>,
    pub d_mat: Array2<T>,
}
Expand description

Implement linear, time-invariant (LTI) dynamics. I.e., $\dot{x} = A x + B u$.

Example

use ndarray::array;
use distributed_control::dynamics::{Dynamics, LtiDynamics};

let dynamics = LtiDynamics::new(array![[0., 1.], [0., 0.]], array![[0.], [1.]]);
assert_eq!(dynamics.dynamics(0., &array![1., 2.], &array![3.]), array![2., 3.]);
assert_eq!(dynamics.n_input(), 1);
assert_eq!(dynamics.n_state(), 2);

Fields§

§a_mat: Array2<T>§b_mat: Array2<T>§c_mat: Array2<T>§d_mat: Array2<T>

Implementations§

source§

impl<T: LinalgScalar> LtiDynamics<T>

source

pub fn new(a_mat: Array2<T>, b_mat: Array2<T>) -> LtiDynamics<T>

Create an LTI system from an $A$ matrix (a_mat) and a $B$ matrix (b_mat)

Trait Implementations§

source§

impl<T: Debug + LinalgScalar> Debug for LtiDynamics<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: LinalgScalar> Dynamics<T> for LtiDynamics<T>

source§

fn n_input(&self) -> usize

Get the dimension of the input $u$.
source§

fn n_state(&self) -> usize

Get the dimension of the state $x$.
source§

fn n_output(&self) -> usize

Get the dimension of the output $y$.
source§

fn dynamics(&self, _t: T, x: &Array1<T>, u: &Array1<T>) -> Array1<T>

Calculate the dynamics, i.e., $\dot{x} = f(t, x, u(t, x))$
source§

fn output(&self, _t: T, x: &Array1<T>, u: &Array1<T>) -> Array1<T>

Calculate the output, i.e., $y = g(t, x, u(t, x))$

Auto Trait Implementations§

§

impl<T> Freeze for LtiDynamics<T>

§

impl<T> RefUnwindSafe for LtiDynamics<T>
where T: RefUnwindSafe,

§

impl<T> Send for LtiDynamics<T>
where T: Send,

§

impl<T> Sync for LtiDynamics<T>
where T: Sync,

§

impl<T> Unpin for LtiDynamics<T>

§

impl<T> UnwindSafe for LtiDynamics<T>
where T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V