Index: mttroot/mtt/lib/control/PPP/ppp_RT_sim_compute.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_RT_sim_compute.m +++ mttroot/mtt/lib/control/PPP/ppp_RT_sim_compute.m @@ -8,11 +8,11 @@ ## System details -- defines simulation within ol interval par = eval(sprintf("%s_numpar;", system_name_sim)); t = [0:simpar_sim.dt:simpar_sim.last]; n_t = length(t); - [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name_sim)); + [n_x,n_y,n_u] = eval(sprintf("%s_def", system_name_sim)); [n_U,junk] = size(A_u_sim); ## Set up u_star u_star = ppp_ustar(A_u_sim,1,t,0,0,n_u-n_U); @@ -19,8 +19,8 @@ ## Simulate par(i_ppp_sim(:,3)) = U; # Update the simulation ppp weights [y_sim,x] = eval(sprintf("%s_sim(x_0_sim, par, simpar_sim, u_star);", \ system_name_sim)); x_0_sim = x(n_t,:)'; # Extract state for next time - u_sim = (u_star*U); + u_sim = u_star(:,1:n_U)*U; endfunction