Revision 1249, 1.2 kB
(checked in by zimamiro, 14 years ago)
|
|
Line | |
---|
1 | function sidps(regulator_parameters, compare_parameters,system,apriori)
|
---|
2 | compare_parameters.student=tinv((1-compare_parameters.alpha)^(1/(regulator_parameters.num_of_candidates-1)),regulator_parameters.num_of_candidates-1);
|
---|
3 | compare_parameters.rinott=4;
|
---|
4 | regulator_parameters.dim=sum(regulator_parameters.H_tilde_on(:));
|
---|
5 |
|
---|
6 | [H_tilde C]=init_hyperstate(regulator_parameters,apriori); %vytvori H_tilde a mi, nastavi H0 a mi*
|
---|
7 |
|
---|
8 | for j=1:regulator_parameters.n_iter
|
---|
9 | j
|
---|
10 | regulator_parameters.search_region=regulator_parameters.gama^(j-1)*regulator_parameters.search_region_init;
|
---|
11 |
|
---|
12 | %prolez mrizku a iteruj rizeni
|
---|
13 | for k=1:regulator_parameters.n_grid^regulator_parameters.dim
|
---|
14 | H0=add_H_tilde0(regulator_parameters,H_tilde,k);
|
---|
15 |
|
---|
16 | u=C(k);
|
---|
17 | candidates=-generate_candidates(abs(u), regulator_parameters);
|
---|
18 | C(k)=choose_best_control(H_tilde,C,H0,k,apriori,regulator_parameters,candidates,compare_parameters,system);
|
---|
19 |
|
---|
20 | end
|
---|
21 |
|
---|
22 | vypis=H_tilde;
|
---|
23 | save 'H_tilde.txt' vypis -ASCII;
|
---|
24 | save 'C.txt' C -ASCII;
|
---|
25 | plot(H_tilde,C); hold on
|
---|
26 | end
|
---|
27 |
|
---|
28 | end
|
---|
29 |
|
---|