Revision 1113, 1.0 kB
(checked in by zimamiro, 14 years ago)
|
|
Line | |
---|
1 | function [m losses]=mc_study(regulator_parameters,system,range,n,co)
|
---|
2 | p=0;
|
---|
3 | [H u]=load_H(co);
|
---|
4 | losses=zeros(4,n);
|
---|
5 |
|
---|
6 | for i=1:n
|
---|
7 | apriori(3)=range.P0;
|
---|
8 | system.b=range.b0 + apriori(3)*randn;
|
---|
9 | apriori(2)=range.b0;
|
---|
10 | apriori(1)=range.y0; %+ range.y0_range*randn;
|
---|
11 | while (system.b==0)
|
---|
12 | system.b=range.b0 + apriori(3)*randn;
|
---|
13 | end
|
---|
14 | %while (apriori(2)==0)
|
---|
15 | % apriori(2)=range.b0 + apriori(3)*randn;
|
---|
16 | %end
|
---|
17 | seed=randn(1,regulator_parameters.horizont);
|
---|
18 |
|
---|
19 | losses(1,i)=ce(regulator_parameters,system,apriori,seed);
|
---|
20 | losses(2,i)=cc(regulator_parameters,system,apriori,seed);
|
---|
21 | losses(3,i)=rizeni(H,u,system,apriori,seed);
|
---|
22 | losses(4,i)=alstr(regulator_parameters,system,apriori,seed);
|
---|
23 |
|
---|
24 | end
|
---|
25 | %losses=min(losses,10);
|
---|
26 | if p==1
|
---|
27 | for i=1:size(losses,1)
|
---|
28 | figure
|
---|
29 | hist(min(losses(i,:),10),100); AXIS([0 10 0 200]); TITLE([median(losses(i,:)) mean(losses(i,:))])
|
---|
30 | end
|
---|
31 | end
|
---|
32 | m=mean(losses,2);
|
---|
33 | end |
---|