LinearSystem_3_2_2
- class wpimath.LinearSystem_3_2_2(a: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 3]'], b: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 2]'], c: Annotated[numpy.typing.ArrayLike, numpy.float64, '[2, 3]'], d: Annotated[numpy.typing.ArrayLike, numpy.float64, '[2, 2]'])
Bases:
pybind11_objectA 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.
a(self: wpimath._wpimath.LinearSystem_3_2_2) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 3]”]
Returns the system matrix A.
a(self: wpimath._wpimath.LinearSystem_3_2_2, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex) -> float
Returns an element of the system matrix A.
- Parameters:
i – Row of A.
j – Column of A.
- b(*args, **kwargs)
Overloaded function.
b(self: wpimath._wpimath.LinearSystem_3_2_2) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 2]”]
Returns the input matrix B.
b(self: wpimath._wpimath.LinearSystem_3_2_2, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex) -> float
Returns an element of the input matrix B.
- Parameters:
i – Row of B.
j – Column of B.
- c(*args, **kwargs)
Overloaded function.
c(self: wpimath._wpimath.LinearSystem_3_2_2) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[2, 3]”]
Returns the output matrix C.
c(self: wpimath._wpimath.LinearSystem_3_2_2, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex) -> float
Returns an element of the output matrix C.
- Parameters:
i – Row of C.
j – Column of C.
- calculate_x(x: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'], clamped_u: Annotated[numpy.typing.ArrayLike, numpy.float64, '[2, 1]'], dt: wpimath.units.seconds) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 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.
clamped_u – The control input.
dt – Timestep for model update.
- calculate_y(x: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'], clamped_u: Annotated[numpy.typing.ArrayLike, numpy.float64, '[2, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[2, 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.
clamped_u – The control input.
- d(*args, **kwargs)
Overloaded function.
d(self: wpimath._wpimath.LinearSystem_3_2_2) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[2, 2]”]
Returns the feedthrough matrix D.
d(self: wpimath._wpimath.LinearSystem_3_2_2, i: typing.SupportsInt | typing.SupportsIndex, j: typing.SupportsInt | typing.SupportsIndex) -> float
Returns an element of the feedthrough matrix D.
- Parameters:
i – Row of D.
j – Column of D.
- slice(*args, **kwargs)
Overloaded function.
slice(self: wpimath._wpimath.LinearSystem_3_2_2, output_index: typing.SupportsInt | typing.SupportsIndex) -> wpimath._wpimath.LinearSystem_3_2_1
Returns the LinearSystem with the outputs listed in output_index.
slice(self: wpimath._wpimath.LinearSystem_3_2_2, output_index0: typing.SupportsInt | typing.SupportsIndex, output_index1: typing.SupportsInt | typing.SupportsIndex) -> wpimath._wpimath.LinearSystem_3_2_2
Returns the LinearSystem with the outputs listed in output_index0 and output_index1.