Index: mttroot/mtt/lib/control/PPP/ppp_output_constraint.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_output_constraint.m +++ mttroot/mtt/lib/control/PPP/ppp_output_constraint.m @@ -46,13 +46,14 @@ endif ## Compute Gamma Gamma = []; + zero_x = zeros(size(x_0)); for i=1:n_U U = zeros(n_U,1); U(i,1) = 1; # Set up U_i - y_i = ppp_ystar (A,B,C,D,x_0,A_u,U,Tau); # Compute y* for ith input for each tau + y_i = ppp_ystar (A,B,C,D,zero_x,A_u,U,Tau); # Compute y* for ith input for each tau y_i = y_i(i_y,:); # Pluck out output i_y ## Gamma = [Gamma [-y_i';y_i']]; # Put in parts for Min and max Gamma_i = []; if (Min>-inf) Gamma_i = [Gamma_i; -y_i']; # Min part of column @@ -62,18 +63,18 @@ endif Gamma = [Gamma Gamma_i]; # Put in parts for Min and max endfor ## Compute gamma - ## gamma = [-Min';Max']; - + zero_U = zeros(size(U)); + y_x = ppp_ystar (A,B,C,D,x_0,A_u,zero_U,Tau); # Output if U is zero gamma = []; if (Min>-inf) - gamma = [gamma; -Min']; + gamma = [gamma; -(Min-y_x)']; endif if (Max