Пример #1
0
 def testAcker(self, siso):
     """Call acker()"""
     acker(siso.ss1.A, siso.ss1.B, [-2, -2.5])
Пример #2
0

print('G(s) =', G)
'''
########################################################
# Input - Polos desejados:
########################################################
'''
poles = [-2+4j, -2-4j, -10]


########################################################
# K - Calculado por Ackerman
########################################################
# Apenas 1 entrada:
K = ctl.acker(A, B, poles)
print('K(ackerman)=', K)

# # Mais de 1 entrada:
# K = ctl.place(A, B, poles)


########################################################
# K - Calculado pelo passo a passo (input alfas)
########################################################
alfa1 = 14
alfa2 = 60
alfa3 = 200
# alfa4 = 0

A2 = np.matmul(A, A)     # Matriz A^2
Пример #3
0
rank = np.linalg.matrix_rank(Uo)  #ランク調査
print(rank)  #ランクが4なら可観測

x0 = np.array([[0.1], [0.1], [0.1], [.1]])
N = 200
t = np.arange(0, N * T + T, T)

x = x0
y = x0.T
for i in range(N):
    x = P.A @ x
    y = np.r_[y, x.T]
#plt.plot(t,y)

Pol = np.array([0.9, 0.9, 0.9, 0.9])
k = matlab.acker(P.A, P.B, Pol)
print('PP k=', k)

x = x0
y = x0.T
for i in range(N):
    x = (P.A - P.B @ k) @ x
    y = np.r_[y, x.T]
#plt.plot(t,y)

Wx = np.identity(4)
Wu = 1
#H,Pol,k=matlab.dare(P.A,P.B,Wx,Wu)
p = P.A
q = P.B
y = np.array([[0, 0, 0, 0]])
Пример #4
0
q = np.array([[1], [0]])
Ev = np.linalg.eigvals(P)
print('Ev=', Ev)

x0 = np.array([[1], [0]])
N = 10
x = x0
y = x.T
for i in range(N):
    x = P @ x
    y = np.r_[y, x.T]
#plt.plot(y)
#print(y)

Pol = np.array([0.5, 0.1])
k = matlab.acker(P, q, Pol)
#print('PP k=', k)
Ev = np.linalg.eigvals(P - q @ k)
#print('Ev=', Ev)

x = x0
y = x.T
for i in range(N):
    x = (P - q @ k) @ x
    y = np.r_[y, x.T]
#plt.plot(y)

Wx = np.identity(2)
Wu = 1
H, Pol, k = matlab.dare(P, q, Wx, Wu)
print('LQ k=', k)