Index: mttroot/mtt/lib/control/PPP/ppp_lin_run.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin_run.m +++ mttroot/mtt/lib/control/PPP/ppp_lin_run.m @@ -56,10 +56,14 @@ endif if !struct_contains(p_c,"T") p_c.T = 10; # Last time point. endif + + if !struct_contains(p_c,"Iterations") + p_c.Iterations = 5; # Number of interations, total =T*Iterations + endif if !struct_contains(p_c,"augment") p_c.augment = 0; # Augment basis funs with constant endif @@ -177,20 +181,20 @@ t_max = 1/min(abs(cl_poles)) t_min = 1/max(abs(cl_poles)) endif ## Initial control U - U = zeros(p_c.n_U,1); + U = zeros(p_c.n_U,1) ## Short sample interval dt = p_c.delta_ol/p_c.N; ## Observer design G = eye(n_x); # State noise gain sigma_x = eye(n_x); # State noise variance - Sigma = p_o.sigma*eye(n_y); # Measurement noise variance + Sigma = p_o.sigma*eye(n_y) # Measurement noise variance if strcmp(p_o.method, "intermittent") Ad = expm(A*p_c.delta_ol); # Discrete-time transition matrix if (ControlType==2) # [L, M, P, obs_poles] = dlqe(Ad,G,C,sigma_x,Sigma); @@ -234,11 +238,12 @@ y_e = []; t_e = []; e_e = []; tick = time; i=0; - for j=1:4 + + for j=1:p_c.Iterations for k=1:I tim=time; # Timing i++; if Simulate # Exact simulation t_sim = [1:p_c.N]*dt; # Simulation time points @@ -295,11 +300,10 @@ else t = [t;t_i]; y = [y;y_i']; u = [u;u_i']; endif - if strcmp(p_o.method, "intermittent") y_e = [y_e; y_new']; e_e = [e_e; e_est']; t_e = [t_e; t_i];