Class LinearSystem<States extends Num,​Inputs extends Num,​Outputs extends Num>

    • Method Detail

      • getA

        public double getA​(int row,
                           int col)
        Returns an element of the system matrix A.
        Parameters:
        row - Row of A.
        col - Column of A.
        Returns:
        the system matrix A at (i, j).
      • getB

        public double getB​(int row,
                           int col)
        Returns an element of the input matrix B.
        Parameters:
        row - Row of B.
        col - Column of B.
        Returns:
        The value of the input matrix B at (i, j).
      • getC

        public double getC​(int row,
                           int col)
        Returns an element of the output matrix C.
        Parameters:
        row - Row of C.
        col - Column of C.
        Returns:
        the double value of C at the given position.
      • getD

        public Matrix<Outputs,​InputsgetD()
        Returns the feedthrough matrix D.
        Returns:
        the feedthrough matrix D.
      • getD

        public double getD​(int row,
                           int col)
        Returns an element of the feedthrough matrix D.
        Parameters:
        row - Row of D.
        col - Column of D.
        Returns:
        The feedthrough matrix D at (i, j).
      • calculateX

        public Matrix<States,​N1calculateX​(Matrix<States,​N1> x,
                                                  Matrix<Inputs,​N1> clampedU,
                                                  double dtSeconds)
        Computes the new x given the old x and the control input.

        This is used by state observers directly to run updates based on state estimate.

        Parameters:
        x - The current state.
        clampedU - The control input.
        dtSeconds - Timestep for model update.
        Returns:
        the updated x.
      • calculateY

        public Matrix<Outputs,​N1calculateY​(Matrix<States,​N1> x,
                                                   Matrix<Inputs,​N1> clampedU)
        Computes the new y given the control input.

        This is used by state observers directly to run updates based on state estimate.

        Parameters:
        x - The current state.
        clampedU - The control input.
        Returns:
        the updated output matrix Y.