summaryrefslogtreecommitdiff
path: root/2048/DEPENDENCIES/mv.sci
diff options
context:
space:
mode:
Diffstat (limited to '2048/DEPENDENCIES/mv.sci')
-rw-r--r--2048/DEPENDENCIES/mv.sci16
1 files changed, 16 insertions, 0 deletions
diff --git a/2048/DEPENDENCIES/mv.sci b/2048/DEPENDENCIES/mv.sci
new file mode 100644
index 000000000..532fc6b4d
--- /dev/null
+++ b/2048/DEPENDENCIES/mv.sci
@@ -0,0 +1,16 @@
+// Minimum variance control law design, given by Eq. 11.40 on page 413.
+// 11.5
+
+// function [S,dS,R,dR] = mv(A,dA,B,dB,C,dC,k,int)
+// implements the minimum variance controller
+// if int>=1, integrated noise is assumed; otherwise,
+// it is not integrated noise
+
+function [S,dS,R,dR] = mv(A,dA,B,dB,C,dC,k,int1)
+zk = zeros(1,k+1); zk(k+1) = 1;
+if int1>=1, [A,dA] = polmul([1 -1],1,A,dA); end
+[Fk,dFk,Ek,dEk] = xdync(zk,k,A,dA,C,dC);
+
+[Gk,dGk] = polmul(Ek,dEk,B,dB);
+S = Fk; dS = dFk; R = Gk; dR = dGk;
+endfunction;