next up previous
Next: Computing tracking Up: Tracking Previous: Tracking

Signal generation

-->rand('normal')
-->// Define the plant
-->nx=5;ny=1;nu=3;
-->Plant=ssrand(ny,nu,nx);
-->J=rand(Plant(5));Plant(5)=0*J;
-->[F,G,H,J]=Plant(2:5);
-->// define state space model of the Signal to track
-->nw=4;nuu=2;
-->A=rand(nw,nw);
-->A=A-maxi(real(spec(A)))*eye(A);
-->B=rand(nw,nuu);
-->C=2*rand(ny,nw);
-->D=0*rand(C*B);
-->xx0=0*ones(nw,1);
-->Model=syslin('c',A,B,C,D,xx0);
-->// Input to Model (t is a vector), nuu components
-->deff('[ut]=uu(t)','ut=[sin(3*t);cos(0.5*t)]');
-->// Compute Signal to track
-->dt=0.05;tmax=60;
-->instants=0:dt:tmax;
-->totrack=flts(uu(instants),dscr(Model,dt));    //Signal
-->plot2d(instants',totrack');
\fbox{\epsfig{file=foo0_96.eps,width=3.75in}}

Scilab group