root/applications/dual/SIDP/jednoduchy system/ce.m @ 937

Revision 862, 0.6 kB (checked in by zimamiro, 15 years ago)
Line 
1function [H,u, loss]=ce(regulator_parameters,system,apriori)
2eps=1;
3
4horizont=regulator_parameters.horizont;
5
6H=zeros(horizont+1,system.dim); % stavy na ridicim horizontu - kazdy bod ma souradnice (y, b, P)
7u=zeros(1,horizont+1);    %u(0)nema smysl
8loss=0;
9
10H(1,1)=apriori.y0;
11H(1,2)=apriori.b0;
12H(1,3)=apriori.P0;
13
14for i=2:horizont
15    if (H(i-1,2)==0)
16        u(i)=(system.yr(i)-H(i-1,1))/eps;
17    else
18        u(i)=(system.yr(i)-H(i-1,1))/H(i-1,2);
19    end
20    H(i,:)=get_next(H(i-1,:),u(i),system);
21    loss=loss+(H(i,1)-system.yr(i))^2;
22end
23
24end
25
Note: See TracBrowser for help on using the browser.