From 6b589b2f39cc5996b7c14006d5be8010afc67e89 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 31 May 2024 01:39:04 +0200 Subject: Update DK iteration and model structure --- pbhtest.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pbhtest.m') 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 -- cgit v1.2.1