Closed-Loop Stability from A Minus BK
~12 mincode completion
Implement closed_loop_stability(A, B, K) returning the array [alpha, stable], where stable is 1.0 if the loop is stable and 0.0 otherwise.
Where this shows up
~12 min
••••••••••••
6 employers weight this skill
4 autonomy companies, 2 defense companies. Top match scores 92.
Python
import numpy as np
def closed_loop_stability(A, B, K):
"""
Largest real part of the closed-loop eigenvalues, and whether it is stable.
Args:
A: state matrix, shape (n, n)
B: input matrix, shape (n, m)
K: gain matrix, shape (m, n), for the law u = -K x
Returns:
array [alpha, stable]: alpha = max real part of eig(A - B K),
stable = 1.0 if alpha < -1e-9 else 0.0
"""
# YOUR CODE HERE
pass