solvers module

dynamapp.solvers.solve_least_square(W: jax.numpy.ndarray, Y: jax.numpy.ndarray) jax.numpy.ndarray

Solves the least squares problem: WX = Y for X.

Args:
  • W: (m, n) matrix (design matrix).

  • Y: (m, k) matrix (target values).

Returns:
  • X: (n, k) matrix (solution to WX = Y).

dynamapp.solvers.solve_riccati_equation(A, B, Q, R)[source]

Solve the discrete-time Algebraic Riccati Equation (ARE):

\[P = A^T . P . A - (A^T . P . B) . (R + B.T .P . B)^{-1}.(B^T . P . A) + Q\]
Args:
  • A: State matrix (n, n)

  • B: Control matrix (n, m)

  • Q: State cost matrix (n, n)

  • R: Control cost matrix (m, m)

Returns:
  • P: Solution to the Riccati equation (n, n)

Note

This function do not work with @jit decorator

dynamapp.solvers.luenberger_observer(A, B, C, desired_poles)

Computes the Luenberger Observer gain matrix L by placing the poles of the observer at the desired_poles.

Args:
  • A (ndarray): System matrix.

  • B (ndarray): Input matrix.

  • C (ndarray): Output matrix.

  • desired_poles (list): Desired poles for the observer.

Returns:

L (ndarray): Observer gain matrix.

Todo

we need to solve the pole placement problem using a custom algorithm the acctual version return a null gain matrix,