Controltools¶
This file contains some functions that are quite helpful when designing feedback laws. This collection is not complete and does not aim to be so. For a more sophisticated collection have a look at the symbtools (https://github.com/TUD-RST/symbtools) or control package which are not used in this package to keep a small footprint.
-
pymoskito.controltools.
char_coefficients
(poles)[source]¶ Calculate the coefficients of a characteristic polynomial.
Parameters: poles (list or numpy.ndarray
) – pol configurationReturns: coefficients Return type: numpy.ndarray
-
pymoskito.controltools.
place_siso
(a_mat, b_mat, poles)[source]¶ Place poles for single input single output (SISO) systems:
- pol placement for state feedback: and
- pol placement for observer: and
Parameters: - a_mat (
numpy.ndarray
) – System matrix.:math:A - b_mat (
numpy.ndarray
) – Input vector or Output matrix . - poles (list or
numpy.ndarray
) – Desired poles.
Returns: Feedback vector or or observer gain .
Return type: numpy.ndarray
-
pymoskito.controltools.
calc_prefilter
(a_mat, b_mat, c_mat, k_mat=None)[source]¶ Calculate the prefilter matrix
Parameters: - a_mat (
numpy.ndarray
) – system matrix - b_mat (
numpy.ndarray
) – input matrix - c_mat (
numpy.ndarray
) – output matrix - k_mat (
numpy.ndarray
) – control matrix
Returns: Prefilter matrix
Return type: numpy.ndarray
- a_mat (
-
pymoskito.controltools.
controllability_matrix
(a_mat, b_mat)[source]¶ Calculate controllability matrix and check controllability of the system.
Parameters: - a_mat (
numpy.ndarray
) – system matrix - b_mat (
numpy.ndarray
) – manipulating matrix
Returns: controllability matrix
Return type: numpy.ndarray
- a_mat (
-
pymoskito.controltools.
observability_matrix
(a_mat, c_mat)[source]¶ Calculate observability matrix and check observability of the system.
Parameters: - a_mat (
numpy.ndarray
) – system matrix - c_mat (
numpy.ndarray
) – output matrix
Returns: observability matrix
Return type: numpy.ndarray
- a_mat (
-
pymoskito.controltools.
lie_derivatives
(h, f, x, order=1)[source]¶ Calculates the Lie-Derivative from a scalar field along a vector field .
Parameters: - h (sympy.matrix) – scalar field
- f (sympy.matrix) – vector field
- x (sympy.matrix) – symbolic representation of the states
- order (int) – order
Returns: lie derivatives in ascending order
Return type: list of sympy.matrix