LinearSystem_1_1_1

class wpimath.system.LinearSystem_1_1_1(A: numpy.ndarray[numpy.float64[1, 1]], B: numpy.ndarray[numpy.float64[1, 1]], C: numpy.ndarray[numpy.float64[1, 1]], D: numpy.ndarray[numpy.float64[1, 1]])

Bases: pybind11_object

A plant defined using state-space notation.

A plant is a mathematical model of a system’s dynamics.

For more on the underlying math, read https://file.tavsys.net/control/controls-engineering-in-frc.pdf.

@tparam States Number of states. @tparam Inputs Number of inputs. @tparam Outputs Number of outputs.

Constructs a discrete plant with the given continuous system coefficients.

Parameters:
  • A – System matrix.

  • B – Input matrix.

  • C – Output matrix.

  • D – Feedthrough matrix. @throws std::domain_error if any matrix element isn’t finite.

A(*args, **kwargs)

Overloaded function.

  1. A(self: wpimath._controls._controls.system.LinearSystem_1_1_1) -> numpy.ndarray[numpy.float64[1, 1]]

Returns the system matrix A.

  1. A(self: wpimath._controls._controls.system.LinearSystem_1_1_1, i: int, j: int) -> float

Returns an element of the system matrix A.

Parameters:
  • i – Row of A.

  • j – Column of A.

B(*args, **kwargs)

Overloaded function.

  1. B(self: wpimath._controls._controls.system.LinearSystem_1_1_1) -> numpy.ndarray[numpy.float64[1, 1]]

Returns the input matrix B.

  1. B(self: wpimath._controls._controls.system.LinearSystem_1_1_1, i: int, j: int) -> float

Returns an element of the input matrix B.

Parameters:
  • i – Row of B.

  • j – Column of B.

C(*args, **kwargs)

Overloaded function.

  1. C(self: wpimath._controls._controls.system.LinearSystem_1_1_1) -> numpy.ndarray[numpy.float64[1, 1]]

Returns the output matrix C.

  1. C(self: wpimath._controls._controls.system.LinearSystem_1_1_1, i: int, j: int) -> float

Returns an element of the output matrix C.

Parameters:
  • i – Row of C.

  • j – Column of C.

D(*args, **kwargs)

Overloaded function.

  1. D(self: wpimath._controls._controls.system.LinearSystem_1_1_1) -> numpy.ndarray[numpy.float64[1, 1]]

Returns the feedthrough matrix D.

  1. D(self: wpimath._controls._controls.system.LinearSystem_1_1_1, i: int, j: int) -> float

Returns an element of the feedthrough matrix D.

Parameters:
  • i – Row of D.

  • j – Column of D.

calculateX(x: numpy.ndarray[numpy.float64[1, 1]], clampedU: numpy.ndarray[numpy.float64[1, 1]], dt: seconds) numpy.ndarray[numpy.float64[1, 1]]

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.

  • dt – Timestep for model update.

calculateY(x: numpy.ndarray[numpy.float64[1, 1]], clampedU: numpy.ndarray[numpy.float64[1, 1]]) numpy.ndarray[numpy.float64[1, 1]]

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.