1 | function [m losses]=mc_study2(regulator_parameters,system,range,n,co,a)
|
---|
2 | p=0;
|
---|
3 | [H u]=load_H(co);
|
---|
4 |
|
---|
5 | for i=1:n
|
---|
6 | apriori(3)=range.P0;
|
---|
7 | system.b=a*range.b0+ apriori(3)*randn;
|
---|
8 | apriori(2)=range.b0;
|
---|
9 | apriori(1)=range.y0;
|
---|
10 | while (system.b==0)
|
---|
11 | system.b=range.b0 + apriori(3)*randn;
|
---|
12 | end
|
---|
13 | seed=randn(1,regulator_parameters.horizont);
|
---|
14 | j=1;
|
---|
15 | losses(j,i)=cc(regulator_parameters,system,apriori,seed);j=j+1;
|
---|
16 | %losses(j,i)=ps(regulator_parameters,system,apriori,seed);j=j+1;
|
---|
17 | losses(j,i)=rizeni(H,u,system,apriori,seed);j=j+1;
|
---|
18 | %losses(j,i)=triv(regulator_parameters,system,apriori,seed);j=j+1;
|
---|
19 | losses(j,i)=alstr(regulator_parameters,system,apriori,seed);j=j+1;
|
---|
20 |
|
---|
21 | end
|
---|
22 | %losses=min(losses,10);
|
---|
23 | if p==1
|
---|
24 | for i=1:size(losses,1)
|
---|
25 | figure
|
---|
26 | hist(min(losses(i,:),10),100); AXIS([0 10 0 200]); TITLE([median(losses(i,:)) mean(losses(i,:))])
|
---|
27 | end
|
---|
28 | end
|
---|
29 | m=mean(losses,2);
|
---|
30 | end |
---|