Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change to code for ctrb and obsv#300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
murrayrm merged 2 commits intopython-control:masterfrombilltubbs:bt-statefbk
May 18, 2019
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletionscontrol/statefbk.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -368,7 +368,7 @@ def lqr(*args, **keywords):

return K, S, E

def ctrb(A,B):
def ctrb(A,B):
"""Controllabilty matrix

Parameters
Expand All@@ -391,10 +391,9 @@ def ctrb(A,B):
amat = np.mat(A)
bmat = np.mat(B)
n = np.shape(amat)[0]

# Construct the controllability matrix
ctrb = bmat
for i in range(1, n):
ctrb = np.hstack((ctrb, amat**i*bmat))
ctrb = np.hstack([bmat] + [amat**i*bmat for i in range(1, n)])
return ctrb

def obsv(A, C):
Expand All@@ -421,10 +420,8 @@ def obsv(A, C):
cmat = np.mat(C)
n = np.shape(amat)[0]

# Construct the controllability matrix
obsv = cmat
for i in range(1, n):
obsv = np.vstack((obsv, cmat*amat**i))
# Construct the observability matrix
obsv = np.vstack([cmat] + [cmat*amat**i for i in range(1, n)])
return obsv

def gram(sys,type):
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp