Revision 1185, 0.8 kB
(checked in by zimamiro, 14 years ago)
|
|
Line | |
---|
1 | function realization=generate_realization(apriori,index,H,C,horizont)
|
---|
2 | eta=apriori.eta0;
|
---|
3 | switch(apriori.Hc)
|
---|
4 | case(0)
|
---|
5 | eta=0;
|
---|
6 | case(1)
|
---|
7 | eta=eta*rand;
|
---|
8 | case(2)
|
---|
9 | %eta=eta*abs((1+randn)/5^(index-1));
|
---|
10 | %eta=eta/10^(-floor(-H(index)/H(end)*size(H,2))-1);
|
---|
11 | eta=eta/10^H(index);
|
---|
12 | case(3)
|
---|
13 | %eta=eta/2*abs((1+randn)/5^(index-1));
|
---|
14 | eta=eta/10^H(index)*rand;
|
---|
15 | end
|
---|
16 |
|
---|
17 | realization=0;
|
---|
18 | beta=H(index);
|
---|
19 | for o=1:horizont
|
---|
20 | best_control=-(eta*beta/(1+beta^2)+interpol(beta,H,C));
|
---|
21 | %best_control=-(eta*beta/(1+beta^2)+C(index)*abs(rand));
|
---|
22 | s=randn;
|
---|
23 | pom=sqrt(1+best_control^2);
|
---|
24 | eta=abs(eta+beta*best_control+pom*s);
|
---|
25 | beta=abs(pom*beta+best_control*s);
|
---|
26 | realization=realization+eta^2;
|
---|
27 | end
|
---|
28 | end |
---|