summaryrefslogtreecommitdiffstats
path: root/pbhtest.m
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-05-31 01:39:04 +0200
committerNao Pross <np@0hm.ch>2024-05-31 01:39:04 +0200
commit6b589b2f39cc5996b7c14006d5be8010afc67e89 (patch)
tree2c4a8a4dd664e719a6509b0604d0d6084d4bb618 /pbhtest.m
parentUpdate DK iterations (diff)
downloaduav-6b589b2f39cc5996b7c14006d5be8010afc67e89.tar.gz
uav-6b589b2f39cc5996b7c14006d5be8010afc67e89.zip
Update DK iteration and model structure
Diffstat (limited to 'pbhtest.m')
-rw-r--r--pbhtest.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/pbhtest.m b/pbhtest.m
index f56aa21..546bbc6 100644
--- a/pbhtest.m
+++ b/pbhtest.m
@@ -1,4 +1,4 @@
-% Do A PBH test on system. Given SYS returns:
+% Do A PBH test on system. Given a state space model SYS returns:
%
% - Nr. of states
% - Nr. of stable states
@@ -23,9 +23,9 @@ end
% Check system controllability / stabilizability
Wc = ctrb(sys);
nctrb = rank(Wc);
+nustab = 0;
if nctrb < nx
% Is the system at least stabilizable?
- nustab = 0;
for i = 1:nx
if real(eigvals(i)) >= 0
% PBH test
@@ -40,13 +40,13 @@ end
% Check system observability / detectability
Wo = obsv(sys);
nobsv = rank(Wo);
+nudetb = 0;
if nobsv < nx
% is the system at least detectable?
- nudetb = 0;
for i = 1:nx
if real(eigvals(i)) >= 0
% PBH test
- W = [sys.C; (sys.A - eigvals(i) * eye(nx))];
+ W = [(sys.A' - eigvals(i) * eye(nx)), sys.C'];
if rank(W) < nx
nudetb = nudetb + 1;
end