Revision 1181, 0.8 kB
(checked in by zimamiro, 14 years ago)
|
|
Line | |
---|
1 | function [ztrata u y b P]=alstr(system,apriori,seed)
|
---|
2 | horizont=system.horizont;
|
---|
3 | sigma=system.sigma;
|
---|
4 |
|
---|
5 | y=zeros(1,horizont);
|
---|
6 | b=zeros(1,horizont);
|
---|
7 | P=zeros(1,horizont);
|
---|
8 | u=zeros(1,horizont-1);
|
---|
9 | ztrata=0;
|
---|
10 |
|
---|
11 | y(1)=apriori.y0;
|
---|
12 | b(1)=apriori.b0;
|
---|
13 | P(1)=apriori.P0;
|
---|
14 |
|
---|
15 |
|
---|
16 | for i=1:horizont
|
---|
17 | eta=abs(y(i))/sigma;
|
---|
18 | beta=abs(b(i))/sqrt(P(i));
|
---|
19 | ny=(0.56+beta)/(2.2+0.08*beta+beta^2)*eta+1.9/(1.7+beta^4);
|
---|
20 |
|
---|
21 | znamenko=sign(y(i)*((-1)^(b(i)<0)));
|
---|
22 | u(i)=-ny*sigma/sqrt(P(i))*znamenko;
|
---|
23 |
|
---|
24 | y(i+1)=y(i)+system.b*u(i)+sigma*seed(i);
|
---|
25 | K=u(i)*P(i)/(P(i)*u(i)^2+sigma^2);
|
---|
26 | b(i+1)=b(i)+K*(y(i+1)-y(i)-b(i)*u(i));
|
---|
27 | P(i+1)=(1-K*u(i))*P(i);
|
---|
28 |
|
---|
29 | ztrata=ztrata+y(i+1)^2;
|
---|
30 |
|
---|
31 | end
|
---|
32 | end
|
---|