Revision 1249, 0.7 kB
(checked in by zimamiro, 14 years ago)
|
|
Line | |
---|
1 | function realization=generate_realization(apriori,H0,H_tilde,C,regulator_parameters,system)
|
---|
2 |
|
---|
3 | H=add_Hc_tilde0(H0,apriori,regulator_parameters); % nehlidam pozitivni definitnost !
|
---|
4 | realization=0;
|
---|
5 | system.S=zeros(1,3);
|
---|
6 | for o=1:regulator_parameters.horizont_simulace
|
---|
7 | [u system]=control(system,H(:,1),interpol(H,H_tilde,C,regulator_parameters.H_tilde_on));
|
---|
8 | system.x=H(:,1)+sqrt(diag(H(:,2:5))).*randn(4,1); %realizace systemu
|
---|
9 |
|
---|
10 | [system.x system.pozorovani]=get_next(system,system.x,u,randn(6,1));
|
---|
11 | H=kalman_filter(H,u,system);
|
---|
12 |
|
---|
13 | realization=realization+u'*system.gamma*u+(system.x-system.x_opt)'*system.ksi*(system.x-system.x_opt);
|
---|
14 | end
|
---|
15 | end |
---|