Changeset 909
- Timestamp:
- 04/20/10 18:55:09 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/dual/IterativeLocal/pmsm_lqg.m
r905 r909 85 85 neznalost = 1; 86 86 87 errnans = 0;88 89 87 % vycisti kreslici okno 90 88 clf … … 141 139 xn(:, 1, n) = x00; 142 140 for k = 1:Kt+K-1, 143 u(:, k) = L(:, :, k)*(xn(:, k, n)); %tady se vyuzije(k) / nevyuzije(1) receding horizon141 u(:, k) = L(:, :, k)*(xn(:, k, n)); 144 142 xn(1, k+1, n) = a*xn(1, k, n) + b*(xn(3, k, n) + xn(5, k, n))*sin(xn(4, k, n)) + c*u(1, k) + sumsim*sqrt(Q(1, 1))*randn(); 145 143 xn(2, k+1, n) = a*xn(2, k, n) - b*(xn(3, k, n) + xn(5, k, n))*cos(xn(4, k, n)) + c*u(2, k) + sumsim*sqrt(Q(2, 2))*randn(); … … 148 146 xn(5, k+1, n) = xn(5, k, n); 149 147 end 150 151 %kontrola spatne L matice 152 lstore(:,:,n) = L(:,:,1); 153 if(isnan(sum(sum(L(:,:,1))))==1) 154 errnans = errnans + 1; 155 end 156 148 149 157 150 %vykresleni 158 151 subplot(2, 3, 1); … … 184 177 toc 185 178 186 if(errnans > 0)187 lstore188 disp('L is NaN')189 errnans190 179 end 191 192 193 194 195 end