summaryrefslogtreecommitdiff
path: root/2048/CH11/EX11.4/mv_mac1.sce
diff options
context:
space:
mode:
Diffstat (limited to '2048/CH11/EX11.4/mv_mac1.sce')
-rwxr-xr-x2048/CH11/EX11.4/mv_mac1.sce48
1 files changed, 48 insertions, 0 deletions
diff --git a/2048/CH11/EX11.4/mv_mac1.sce b/2048/CH11/EX11.4/mv_mac1.sce
new file mode 100755
index 000000000..ea499c83c
--- /dev/null
+++ b/2048/CH11/EX11.4/mv_mac1.sce
@@ -0,0 +1,48 @@
+// MacGregor's first control problem, discussed in Example 11.4 on page 213.
+// 11.4
+
+exec('mv.sci',-1);
+exec('cl.sci',-1);
+exec('cosfil_ip.sci',-1);
+exec('zpowk.sci',-1);
+exec('xdync.sci',-1);
+exec('rowjoin.sci',-1);
+exec('polsize.sci',-1);
+exec('left_prm.sci',-1);
+exec('t1calc.sci',-1);
+exec('indep.sci',-1);
+exec('seshft.sci',-1);
+exec('makezero.sci',-1);
+exec('move_sci.sci',-1);
+exec('colsplit.sci',-1);
+exec('clcoef.sci',-1);
+exec('cindep.sci',-1);
+exec('polmul.sci',-1);
+exec('poladd.sci',-1);
+exec('tfvar.sci',-1);
+exec('l2r.sci',-1);
+exec('transp.sci',-1);
+exec('tf.sci',-1);
+exec('covar_m.sci',-1);
+exec('polyno.sci',-1);
+
+// MacGregor's first control problem
+A = [1 -1.4 0.45]; dA = 2; C = [1 -0.5]; dC = 1;
+B = 0.5*[1 -0.9]; dB = 1; k = 1; int1 = 0;
+[Sc,dSc,Rc,dRc] = mv(A,dA,B,dB,C,dC,k,int1);
+[Nu,dNu,Du,dDu,Ny,dNy,Dy,dDy,yvar,uvar] = ...
+cl(A,dA,B,dB,C,dC,k,Sc,dSc,Rc,dRc,int1);
+
+// Simulation parameters for stb_disc.xcos
+Tc = Sc; gamm = 1; [zk,dzk] = zpowk(k);
+D = 1; N_var = 1; Ts = 1; st = 0;
+t_init = 0; t_final = 1000;
+
+[Tcp1,Tcp2] = cosfil_ip(Tc,1); // Tc/1
+[Rcp1,Rcp2] = cosfil_ip(1,Rc); // 1/Rc
+[Scp1,Scp2] = cosfil_ip(Sc,1); // Sc/1
+[Bp,Ap] = cosfil_ip(B,A); // B/A
+[zkp1,zkp2] = cosfil_ip(zk,1); // zk/1
+[Cp,Dp] = cosfil_ip(C,D); // C/D
+
+